"use client"; import { Button } from "@app/components/ui/button"; import { Switch } from "@app/components/ui/switch"; import { cn } from "@app/lib/cn"; import { useTranslations } from "next-intl"; export type PolicyAuthMethodRowProps = { id: string; title: string; description: string; summary: string; active: boolean; onConfigure: () => void; onToggle: (active: boolean) => void; disabled?: boolean; configureDisabled?: boolean; }; export function PolicyAuthMethodRow({ id, title, description, summary, active, onConfigure, onToggle, disabled, configureDisabled = disabled }: PolicyAuthMethodRowProps) { const t = useTranslations(); const canEdit = active && !configureDisabled; const canEnable = !active && !disabled; const isRowInteractive = canEdit || canEnable; const handleRowClick = () => { if (canEdit) { onConfigure(); return; } if (canEnable) { onToggle(true); } }; return (
{active ? summary : description}