"use client"; import { SettingsFormCell, SettingsFormGrid, SettingsSubsectionDescription, SettingsSubsectionHeader, SettingsSubsectionTitle } from "@app/components/Settings"; import { useTranslations } from "next-intl"; import { PolicyAuthMethodRow } from "./PolicyAuthMethodRow"; import type { PolicyAuthMethodId } from "./policy-auth-method-id"; import { getEmailWhitelistSummary, getHeaderAuthSummary, getPasscodeSummary, getPincodeSummary } from "./policy-auth-summaries"; export type PolicyAuthOtherMethodsSectionProps = { pinActive: boolean; passcodeActive: boolean; emailWhitelistEnabled: boolean; headerAuthActive: boolean; headerAuthUser: string; emailCount: number; emailEnabled: boolean; disabled?: boolean; onConfigure: (method: PolicyAuthMethodId) => void; onTogglePincode: (active: boolean) => void; onTogglePasscode: (active: boolean) => void; onToggleEmail: (active: boolean) => void; onToggleHeaderAuth: (active: boolean) => void; }; export function PolicyAuthOtherMethodsSection({ pinActive, passcodeActive, emailWhitelistEnabled, headerAuthActive, headerAuthUser, emailCount, emailEnabled, disabled, onConfigure, onTogglePincode, onTogglePasscode, onToggleEmail, onToggleHeaderAuth }: PolicyAuthOtherMethodsSectionProps) { const t = useTranslations(); return ( {t("policyAuthOtherMethodsTitle")} {t("policyAuthOtherMethodsDescription")}
onConfigure("pincode")} onToggle={onTogglePincode} disabled={disabled} /> onConfigure("passcode")} onToggle={onTogglePasscode} disabled={disabled} /> onConfigure("email")} onToggle={onToggleEmail} disabled={disabled || !emailEnabled} /> onConfigure("headerAuth")} onToggle={onToggleHeaderAuth} disabled={disabled} />
); }