import type { ColumnDef } from '@tanstack/table-core';
import type { Seal } from '$lib/api/dashboard/a76/general_catalogs/seal';
import { renderComponent } from '$lib/components/ui/data-table';
import DataTableActions from './data-table-actions.svelte';

export function createColumns(onSuccess?: () => void): ColumnDef<Seal>[] {
    return [
    
        {
            accessorKey: 'seal',
            header: 'Sello',
            cell: ({ row }) => row.original.seal,
        },
        {
            id: 'actions',
            header: 'Acciones',
            meta: {
                class: 'w-[100px] text-right' 
            },
            cell: ({ row }) => renderComponent(DataTableActions, {
                item: row.original,
                onSuccess
            })
        }
    ];
}