mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
Merge 858c41b01d into 5bfebc7c9d
This commit is contained in:
commit
6f1011e97f
1 changed files with 31 additions and 20 deletions
|
|
@ -438,7 +438,16 @@ export default function DataTable<TData, TValue>({
|
||||||
<TableHeader className="sticky top-0 z-50 bg-surface-secondary">
|
<TableHeader className="sticky top-0 z-50 bg-surface-secondary">
|
||||||
{table.getHeaderGroups().map((headerGroup) => (
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
<TableRow key={headerGroup.id} className="border-b border-border-light">
|
<TableRow key={headerGroup.id} className="border-b border-border-light">
|
||||||
{headerGroup.headers.map((header) => (
|
{headerGroup.headers.map((header) => {
|
||||||
|
const sortState = header.column.getIsSorted();
|
||||||
|
let ariaSort: 'ascending' | 'descending' | undefined;
|
||||||
|
if (sortState === 'asc') {
|
||||||
|
ariaSort = 'ascending';
|
||||||
|
} else if (sortState === 'desc') {
|
||||||
|
ariaSort = 'descending';
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
<TableHead
|
<TableHead
|
||||||
key={header.id}
|
key={header.id}
|
||||||
className="whitespace-nowrap bg-surface-secondary px-2 py-2 text-left text-sm font-medium text-text-secondary sm:px-4"
|
className="whitespace-nowrap bg-surface-secondary px-2 py-2 text-left text-sm font-medium text-text-secondary sm:px-4"
|
||||||
|
|
@ -452,12 +461,14 @@ export default function DataTable<TData, TValue>({
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
scope="col"
|
scope="col"
|
||||||
|
aria-sort={ariaSort}
|
||||||
>
|
>
|
||||||
{header.isPlaceholder
|
{header.isPlaceholder
|
||||||
? null
|
? null
|
||||||
: flexRender(header.column.columnDef.header, header.getContext())}
|
: flexRender(header.column.columnDef.header, header.getContext())}
|
||||||
</TableHead>
|
</TableHead>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
))}
|
))}
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue