add support id
This commit is contained in:
@@ -33,6 +33,7 @@ type FileItem = {
|
||||
status?: string;
|
||||
protectStatus: string;
|
||||
_original?: ApiFile;
|
||||
supportId: number;
|
||||
};
|
||||
|
||||
type ApiFile = {
|
||||
@@ -44,6 +45,7 @@ type ApiFile = {
|
||||
updatedAt: string;
|
||||
status: string;
|
||||
protectStatus: string;
|
||||
supportId: number;
|
||||
};
|
||||
|
||||
type ApiResponse = {
|
||||
@@ -146,6 +148,7 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
|
||||
uploadDate: newDate,
|
||||
status: item.status,
|
||||
protectStatus: item.protectStatus,
|
||||
supportId: item.supportId,
|
||||
_original: item
|
||||
};
|
||||
});
|
||||
@@ -174,6 +177,41 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
|
||||
// Определение колонок
|
||||
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',
|
||||
header: ({ column }) => (
|
||||
|
||||
@@ -695,6 +695,10 @@
|
||||
&:last-child {
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
&:has(.table-item-id) {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.table-item {
|
||||
|
||||
Reference in New Issue
Block a user