import { useState } from "react"; import { Shield } from "lucide-react"; import { Button } from "~/client/components/ui/button"; import { CardContent, CardDescription, CardTitle } from "~/client/components/ui/card"; import { TwoFactorSetupDialog } from "./two-factor-setup-dialog"; import { TwoFactorDisableDialog } from "./two-factor-disable-dialog"; import { BackupCodesDialog } from "./backup-codes-dialog"; type TwoFactorSectionProps = { twoFactorEnabled?: boolean | null; }; export const TwoFactorSection = ({ twoFactorEnabled }: TwoFactorSectionProps) => { const [setupDialogOpen, setSetupDialogOpen] = useState(false); const [disableDialogOpen, setDisableDialogOpen] = useState(false); const [backupCodesDialogOpen, setBackupCodesDialogOpen] = useState(false); const handleSuccess = async () => { window.location.reload(); }; return ( <>
Two-Factor Authentication Add an extra layer of security to your account

Status:  {twoFactorEnabled ? ( Enabled ) : ( Disabled )}

Two-factor authentication adds an extra layer of security by requiring a code from your authenticator app in addition to your password.

{!twoFactorEnabled ? ( ) : (
)}
); };