"use client" import { CellContext, ColumnDef, createColumnHelper } from "@tanstack/react-table" import { ArrowUpDown, BookText, CalendarMinus, CalendarPlus, MessageCircleReply, NotepadText } from "lucide-react" import { Button } from "@/components/ui/button" import { SubComplete } from "./page" import { selectCol } from "app/ui/tables/selectColumn" import TitleContainer from "app/ui/titleContainer" import { CalendarArrowUp } from "lucide" export const columns: ColumnDef[] = [ selectCol, { accessorFn: row => { if (row.story) { return row.story.title } return "RECORD DELETED" }, id: "story", header: () => ( <> Story ), cell: (props: CellContext) => ({props.getValue()}) }, { accessorFn: row => { if (row.pub) { return row.pub.title } return "RECORD DELETED" }, id: "pub", header: () => ( <> Publication ), cell: (props: CellContext) => ({props.getValue()}) }, { accessorFn: row => new Date(row.submitted), id: "submitted", header: ({ column }) => { return ( ) }, enableColumnFilter: false, sortingFn: "datetime", cell: (props: CellContext) => (

{props.getValue().toLocaleDateString('ES', { day: 'numeric', month: 'numeric', year: '2-digit' })}

) }, { accessorFn: row => row.responded ? new Date(row.responded) : null, id: "responded", header: ({ column }) => { return ( ) }, enableColumnFilter: false, sortingFn: "datetime", cell: (props: CellContext) => (

{props.getValue()?.toLocaleDateString('ES', { day: 'numeric', month: 'numeric', year: '2-digit' })}

) }, { accessorFn: row => { if (row.response) { return row.response.response } return "RECORD DELETED" }, id: "response", header: ({ column }) => { return ( ) }, cell: (props: CellContext) => (

{props.getValue()}

) }, ]