Updated the grading system to work based on entities
This commit is contained in:
@@ -11,10 +11,11 @@ interface Props<T> {
|
||||
searchFields: string[][]
|
||||
size?: number
|
||||
onDownload?: (rows: T[]) => void
|
||||
isDownloadLoading?: boolean
|
||||
searchPlaceholder?: string
|
||||
}
|
||||
|
||||
export default function Table<T>({ data, columns, searchFields, size = 16, onDownload, searchPlaceholder }: Props<T>) {
|
||||
export default function Table<T>({ data, columns, searchFields, size = 16, onDownload, isDownloadLoading, searchPlaceholder }: Props<T>) {
|
||||
const [pagination, setPagination] = useState<PaginationState>({
|
||||
pageIndex: 0,
|
||||
pageSize: size,
|
||||
@@ -39,7 +40,7 @@ export default function Table<T>({ data, columns, searchFields, size = 16, onDow
|
||||
<div className="w-full flex gap-2 items-end">
|
||||
{renderSearch()}
|
||||
{onDownload && (
|
||||
<Button className="w-full max-w-[200px] mb-1" variant="outline" onClick={() => onDownload(rows)}>
|
||||
<Button isLoading={isDownloadLoading} className="w-full max-w-[200px] mb-1" variant="outline" onClick={() => onDownload(rows)}>
|
||||
Download
|
||||
</Button>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user