"use client"; import { Pencil } from "lucide-react"; import Link from "next/link"; import { DataTable } from "@/components/admin/data-table"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import type { DataTableColumn, PaginatedResult } from "@/types"; interface PollRow { id: number; title: string; status: string; showResults: number; multipleChoice: number; startsAt: Date | null; endsAt: Date | null; createdAt: Date; } const statusVariants: Record = { active: "default", draft: "secondary", closed: "outline", }; function getColumns(): DataTableColumn[] { return [ { key: "id", label: "ID", sortable: true }, { key: "title", label: "Title", sortable: true, render: (value) => {String(value)}, }, { key: "status", label: "Status", sortable: true, render: (value) => ( {String(value)} ), }, { key: "multipleChoice", label: "Type", render: (value) => ( {Number(value) ? "Multiple choice" : "Single choice"} ), }, { key: "createdAt", label: "Created", sortable: true, render: (value) => ( {new Date(value as unknown as string).toLocaleDateString()} ), }, { key: "actions", label: "Actions", render: (_, row) => ( ), }, ]; } interface PollsTableProps { data: PaginatedResult; } export function PollsTable({ data }: PollsTableProps) { return ; }