{
  "aliases": [
    "recovery-email",
    "backup-codes",
    "security-settings",
    "recovery-settings"
  ],
  "code": "// Research basis: Google Account recovery (email/phone + backup codes), Microsoft Security info,\n// GitHub recovery codes. Signed-IN recovery SETTINGS (manage your methods) is a DIFFERENT surface\n// from the signed-OUT forgot-password JOURNEY — do not mix them on one page.\nimport { Card, CardContent, CardHeader, CardTitle, ListRow, Badge } from \"@godxjp/ui/data-display\";\nimport { Button } from \"@godxjp/ui/general\";\nimport { Flex } from \"@godxjp/ui/layout\";\nimport { Mail, Smartphone, KeyRound } from \"lucide-react\";\n\ntype MethodStatus = \"verified\" | \"unverified\" | \"unavailable\";\n\nconst STATUS: Record<MethodStatus, { tone: \"success\" | \"warning\" | \"neutral\"; label: string }> = {\n  verified: { tone: \"success\", label: \"確認済み\" },\n  unverified: { tone: \"warning\", label: \"未確認\" },\n  unavailable: { tone: \"neutral\", label: \"未設定\" },\n};\n\nfunction MethodRow({ icon: Icon, name, value, status, action }: {\n  icon: React.ComponentType<{ className?: string }>; name: string; value?: string;\n  status: MethodStatus; action: React.ReactNode;\n}) {\n  const s = STATUS[status];\n  return (\n    <ListRow\n      leading={<Icon className=\"text-muted-foreground size-5\" />}\n      title={<span className=\"font-medium\">{name}</span>}\n      description={value ?? \"未設定\"}\n      trailing={<Flex gap=\"sm\" align=\"center\"><Badge tone={s.tone} icon={null}>{s.label}</Badge>{action}</Flex>}\n    />\n  );\n}\n\n// Compact status/action rows — one row per method, capability-aware. Do NOT stack full-width\n// Info Alerts for ordinary status, and do NOT show unavailable features as permanent page content\n// beyond a single row that offers to set them up.\nexport function AccountRecoverySettings({ email, phone, backupCodesSupported, backupCodesRemaining, onChangeEmail, onChangePhone, onRegenerateCodes, onChangePassword }: {\n  email?: string; phone?: string; backupCodesSupported: boolean; backupCodesRemaining: number;\n  onChangeEmail: () => void; onChangePhone: () => void; onRegenerateCodes: () => void; onChangePassword: () => void;\n}) {\n  return (\n    <Flex direction=\"col\" gap=\"lg\">\n      <Card>\n        <CardHeader><CardTitle>アカウント復旧</CardTitle></CardHeader>\n        <CardContent flush>\n          <MethodRow icon={Mail} name=\"復旧用メール\" value={email} status={email ? \"verified\" : \"unavailable\"}\n            action={<Button variant=\"outline\" size=\"sm\" onClick={onChangeEmail}>{email ? \"変更\" : \"追加\"}</Button>} />\n          <MethodRow icon={Smartphone} name=\"復旧用電話番号\" value={phone} status={phone ? \"verified\" : \"unavailable\"}\n            action={<Button variant=\"outline\" size=\"sm\" onClick={onChangePhone}>{phone ? \"変更\" : \"追加\"}</Button>} />\n          {/* Capability-aware: only render backup codes when the account type supports them. */}\n          {backupCodesSupported && (\n            <MethodRow icon={KeyRound} name=\"バックアップコード\"\n              value={`残り ${backupCodesRemaining} 個`} status={backupCodesRemaining > 0 ? \"verified\" : \"unverified\"}\n              action={<Button variant=\"outline\" size=\"sm\" onClick={onRegenerateCodes}>再生成</Button>} />\n          )}\n        </CardContent>\n      </Card>\n\n      {/* Password change is its OWN destination (risk-appropriate confirmation lives there). */}\n      <Card>\n        <CardHeader><CardTitle>パスワード</CardTitle></CardHeader>\n        <CardContent>\n          <Flex justify=\"between\" align=\"center\">\n            <span className=\"text-muted-foreground text-sm\">最終更新: 90日前</span>\n            <Button variant=\"outline\" onClick={onChangePassword}>パスワードを変更</Button>\n          </Flex>\n        </CardContent>\n      </Card>\n    </Flex>\n  );\n}\n// The signed-OUT recovery journey (forgot password → email link → reset) is a separate flow on the\n// auth screens (CenteredShell variant=\"auth\"), NOT part of these signed-in settings. Do not surface it here.",
  "name": "account-recovery-settings",
  "tagline": "Signed-in recovery: compact method status/action rows (email · phone · backup codes) + a separate password-change destination — capability-aware, risk-appropriate, NO stacked Info Alerts.",
  "tags": [
    "account",
    "recovery",
    "security",
    "backup-codes",
    "password",
    "settings"
  ]
}
