import React from "react";
import { useNavigation } from "../../context/NavigationContext";
import { SettingsRow, SettingsSection } from "../settings-row";
import { useAppConfig } from "../../context/AppConfigContext";
/**
 * Generic ACCOUNT section used inside the settings dialog. Rows:
 *   • Profile (delegates to `onOpenProfile?.("profile")`)
 *   • Master Password (delegates to `onOpenProfile?.("security")`)
 *   • Server Configuration (default navigates to `routes.serverConfig`)
 */
export function AccountSection({ onClose, onOpenProfile, onOpenServerConfig, }) {
    const router = useNavigation();
    const { routes } = useAppConfig();
    const handleServerConfig = onOpenServerConfig === undefined
        ? () => {
            onClose();
            router.push(routes.serverConfig);
        }
        : onOpenServerConfig;
    return (<SettingsSection title="ACCOUNT">
      <SettingsRow icon="person-outline" label="Profile" onPress={() => {
            onClose();
            onOpenProfile?.("profile");
        }} showChevron/>
      <SettingsRow icon="key-outline" label="Master Password" onPress={() => {
            onClose();
            onOpenProfile?.("security");
        }} showChevron/>
      {handleServerConfig ? (<SettingsRow icon="server-outline" label="Server Configuration" onPress={handleServerConfig} showChevron/>) : null}
    </SettingsSection>);
}
//# sourceMappingURL=AccountSection.jsx.map