add support id

This commit is contained in:
smanylov
2026-01-26 16:38:24 +07:00
parent ab652117c8
commit e9e9f41f2a
2 changed files with 42 additions and 0 deletions
+38
View File
@@ -33,6 +33,7 @@ type FileItem = {
status?: string; status?: string;
protectStatus: string; protectStatus: string;
_original?: ApiFile; _original?: ApiFile;
supportId: number;
}; };
type ApiFile = { type ApiFile = {
@@ -44,6 +45,7 @@ type ApiFile = {
updatedAt: string; updatedAt: string;
status: string; status: string;
protectStatus: string; protectStatus: string;
supportId: number;
}; };
type ApiResponse = { type ApiResponse = {
@@ -146,6 +148,7 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
uploadDate: newDate, uploadDate: newDate,
status: item.status, status: item.status,
protectStatus: item.protectStatus, protectStatus: item.protectStatus,
supportId: item.supportId,
_original: item _original: item
}; };
}); });
@@ -174,6 +177,41 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
// Определение колонок // Определение колонок
const columns = useMemo<ColumnDef<FileItem>[]>( const columns = useMemo<ColumnDef<FileItem>[]>(
() => [ () => [
{
accessorKey: 'id',
header: ({ column }) => (
<div className="column">
<span>
ID
</span>
<button
onClick={() => column.toggleSorting(column.getIsSorted() === 'asc')}
className="sort-button"
>
{
column.getIsSorted() === 'asc' ?
<span>
<IconArrowUp />
</span>
: column.getIsSorted() === 'desc' ?
<span>
<IconArrowDown />
</span>
: <span>
<IconFilter />
</span>
}
</button>
</div>
),
cell: ({ row }) => {
return (
<div className="text-center table-item table-item-id">
{row.original.supportId ? row.original.supportId: '-'}
</div>
)
},
},
{ {
accessorKey: 'fileName', accessorKey: 'fileName',
header: ({ column }) => ( header: ({ column }) => (
+4
View File
@@ -695,6 +695,10 @@
&:last-child { &:last-child {
padding-right: 15px; padding-right: 15px;
} }
&:has(.table-item-id) {
width: 20px;
}
} }
.table-item { .table-item {