feat: add size to datatable
This commit is contained in:
parent
bc4b528ac6
commit
e2673fa9e1
2 changed files with 3 additions and 0 deletions
|
@ -9,6 +9,7 @@ import useFetch from 'lib/hooks/useFetch';
|
|||
import { usePaginatedFiles, useRecent } from 'lib/queries/files';
|
||||
import { useStats } from 'lib/queries/stats';
|
||||
import { userSelector } from 'lib/recoil/user';
|
||||
import { bytesToHuman } from 'lib/utils/bytes';
|
||||
import { DataTable, DataTableSortStatus } from 'mantine-datatable';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
@ -157,6 +158,7 @@ export default function Dashboard({ disableMediaPreview, exifEnabled }) {
|
|||
columns={[
|
||||
{ accessor: 'name', sortable: true },
|
||||
{ accessor: 'mimetype', sortable: true },
|
||||
{ accessor: 'size', sortable: true, render: (file) => bytesToHuman(file.size) },
|
||||
{
|
||||
accessor: 'createdAt',
|
||||
sortable: true,
|
||||
|
|
|
@ -9,6 +9,7 @@ export type UserFilesResponse = {
|
|||
id: string;
|
||||
favorite: boolean;
|
||||
url: string;
|
||||
size: number;
|
||||
};
|
||||
|
||||
export const useFiles = (query: { [key: string]: string } = {}) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue