import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Switch } from "@/components/ui/switch"; import { Trash2, Edit } from "lucide-react"; import { CorsEntry } from "@/lib/features/cors/corsSlice"; interface CorsTableProps { data: CorsEntry[]; type: "whitelist" | "blacklist"; onDelete: (id: string) => void; onEdit: (entry: CorsEntry) => void; onToggleActive: (id: string, currentStatus: boolean) => void; } export function CorsTable({ data, type, onDelete, onEdit, onToggleActive }: CorsTableProps) { return (
Origin {type === "whitelist" ? "Açıklama" : "Sebep"} Durum Oluşturan İşlemler {data.length === 0 ? ( Kayıt bulunamadı. ) : ( data.map((entry) => ( {entry.origin} {type === "whitelist" ? entry.description : entry.reason}
onToggleActive(entry.id, entry.is_active)} /> {entry.is_active ? "Aktif" : "Pasif"}
{entry.created_by}
)) )}
); }