// One row in the per-kind list view. Shows just enough to identify the // adapter at a glance (name + projected summary + token state + the two // flags) plus the inline enable toggle. Real editing always goes through // the dialog — there are no live-typed inputs here. import { motion } from 'motion/react'; import { Pencil, Trash2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { cn } from '@/lib/utils'; import type { AdapterCommon } from './defaults'; interface NodeSummaryCardProps { item: T; summary: string; duplicateName: boolean; onToggleEnabled: (next: boolean) => void; onEdit: () => void; onDelete: () => void; } export function NodeSummaryCard({ item, summary, duplicateName, onToggleEnabled, onEdit, onDelete, }: NodeSummaryCardProps) { const enabled = item.enabled !== false; const blankName = !item.name?.trim(); return (
{item.name || '(未命名)'} {duplicateName && ( 名称重复 )} {!enabled && ( 已停用 )}
{summary}
{item.messageFormat === 'string' ? 'CQ 码' : '数组'} {item.reportSelfMessage ? '上报自身' : '不上报自身'} {item.accessToken ? ( 已设 Token ) : ( 无 Token )}
); } interface ToggleSwitchProps { value: boolean; onChange: (v: boolean) => void; ariaLabel: string; } function ToggleSwitch({ value, onChange, ariaLabel }: ToggleSwitchProps) { return ( ); }