'use client';
import { useMemo } from 'react';
import type { ColumnDef } from '@tanstack/react-table';
import { Badge } from '@/components/ui/badge';
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import type { Project } from '@/types';
function EmptyValue() {
return -;
}
function StateBadges({ value }: { value: string | null }) {
if (!value) {
return ;
}
const states = value
.split(',')
.map((state) => state.trim())
.filter(Boolean);
if (!states.length) {
return ;
}
const [firstState, ...remainingStates] = states;
return (
{firstState}
{remainingStates.length > 0 ? (
Other States
{remainingStates.map((state) => (
{state}
))}
) : null}
);
}
export function useProjectColumns() {
return useMemo[]>(
() => [
{
accessorKey: 'name',
header: 'Project Name',
cell: ({ row }) => {row.original.name}
,
},
{
accessorKey: 'state',
header: 'State',
cell: ({ row }) => ,
},
{
accessorKey: 'corridor_name',
header: 'Corridor',
cell: ({ row }) => row.original.corridor_name || ,
},
],
[],
);
}