add support id
This commit is contained in:
@@ -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 }) => (
|
||||||
|
|||||||
@@ -695,6 +695,10 @@
|
|||||||
&:last-child {
|
&:last-child {
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:has(.table-item-id) {
|
||||||
|
width: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-item {
|
.table-item {
|
||||||
|
|||||||
Reference in New Issue
Block a user