import React from 'react'; import { cn } from '../../lib/utils'; import { motion, AnimatePresence } from 'framer-motion'; import { Info, type LucideIcon } from 'lucide-react'; import { Switch } from './switch'; import { SafeRender } from './settings-ui'; interface CompactSettingCardProps { title: string; description?: string; icon?: LucideIcon; checked?: boolean; onChange?: (checked: boolean) => void; statusMessage?: React.ReactNode; statusType?: 'active' | 'inactive' | 'error' | 'warning'; disabled?: boolean; className?: string; children?: React.ReactNode; hideSwitch?: boolean; rightAction?: React.ReactNode; } export const CompactSettingCard: React.FC = ({ title, description, icon: Icon, checked, onChange, statusMessage, statusType = 'active', disabled = false, className = "", children, hideSwitch = false, rightAction }) => { const statusStyles = { active: 'text-emerald-600 bg-emerald-50/50 border-emerald-100', inactive: 'text-slate-500 bg-slate-50/50 border-slate-100', error: 'text-rose-600 bg-rose-50/50 border-rose-100', warning: 'text-amber-600 bg-amber-50/50 border-amber-100' }; return (
{/* Header Row */}
{Icon && ( )}

{description && (
)}
{rightAction && (
{rightAction}
)} {!hideSwitch && onChange !== undefined && checked !== undefined && ( )}
{/* Children Content */} {children && (
{children}
)} {/* Status Box */} {statusMessage && (
)}
); };