Lista osp muestra status de guardado (borrador, publicado)

This commit is contained in:
2026-04-08 20:13:16 -04:00
parent 2da200a491
commit ac6ab78ccd

View File

@@ -22,18 +22,9 @@ export function columns({ apiUrl }: ColumnsProps): ColumnDef<TrainingSchema>[] {
accessorKey: 'ospType', accessorKey: 'ospType',
header: 'Tipo', header: 'Tipo',
}, },
{
accessorKey: 'created_at',
header: 'Fecha de creación',
cell: ({ row }) => {
// console.log(row.getValue('created_at'));
const date = row.getValue('created_at') as string;
return date ? new Date(date).toLocaleString() : 'N/A';
},
},
{ {
accessorKey: 'currentStatus', accessorKey: 'currentStatus',
header: 'Estatus', header: 'Estatus OSP',
cell: ({ row }) => { cell: ({ row }) => {
const status = row.getValue('currentStatus') as string; const status = row.getValue('currentStatus') as string;
return ( return (
@@ -43,6 +34,16 @@ export function columns({ apiUrl }: ColumnsProps): ColumnDef<TrainingSchema>[] {
); );
}, },
}, },
{
accessorKey: 'created_at',
header: 'Fecha de creación',
cell: ({ row }) => {
// console.log(row.getValue('created_at'));
const date = row.getValue('created_at') as string;
return date ? new Date(date).toLocaleString() : 'N/A';
},
},
{ {
accessorKey: 'visitDate', accessorKey: 'visitDate',
header: 'Fecha Visita', header: 'Fecha Visita',
@@ -51,6 +52,18 @@ export function columns({ apiUrl }: ColumnsProps): ColumnDef<TrainingSchema>[] {
return date ? new Date(date).toLocaleString() : 'N/A'; return date ? new Date(date).toLocaleString() : 'N/A';
}, },
}, },
{
accessorKey: 'surveyStatus',
header: '',
cell: ({ row }) => {
const status = row.getValue('surveyStatus') as string;
return (
<Badge variant={status === 'PUBLICADO' ? 'default' : 'secondary'}>
{status}
</Badge>
);
},
},
{ {
id: 'actions', id: 'actions',
header: 'Acciones', header: 'Acciones',