import React from "react"; import { Download, Info, Loader2, Pencil, Plus, Trash2, Upload } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Separator } from "@/components/ui/separator"; import { Switch } from "@/components/ui/switch"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Textarea } from "@/components/ui/textarea"; import { cn } from "@/lib/utils"; import type { AiBuilderAgentConfig, AiBuilderRuleItem } from "./types"; // --------------------------------------------------------------------------- // SectionHeader // --------------------------------------------------------------------------- export type SectionHeaderProps = { title: string; description: string; className?: string; }; export function SectionHeader({ title, description, className, }: SectionHeaderProps) { return (

{title}

{description}

); } // --------------------------------------------------------------------------- // SettingRow // --------------------------------------------------------------------------- export type SettingRowProps = { icon: React.ReactNode; label: string; description: string; control: React.ReactNode; className?: string; }; export function SettingRow({ icon, label, description, control, className, }: SettingRowProps) { return (
{icon}
{label} {description}
{control}
); } // --------------------------------------------------------------------------- // SettingCard — wraps SettingRows with a bordered card + dividers // --------------------------------------------------------------------------- export type SettingCardProps = { rows: SettingRowProps[]; className?: string; }; export function SettingCard({ rows, className }: SettingCardProps) { return (
{rows.map((row, i) => ( {i < rows.length - 1 && } ))}
); } // --------------------------------------------------------------------------- // AgentConfigForm // --------------------------------------------------------------------------- export type AgentConfigFormProps = { config: AiBuilderAgentConfig; onChange: (config: AiBuilderAgentConfig) => void; className?: string; }; export function AgentConfigForm({ config, onChange, className, }: AgentConfigFormProps) { return (
onChange({ ...config, name: e.target.value })} />