mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 06:45:46 +00:00
feat: implement export to excel
This commit is contained in:
@@ -183,6 +183,9 @@ const TransferToLayingsTable = () => {
|
|||||||
|
|
||||||
const isFilterActive = filterCount > 0;
|
const isFilterActive = filterCount > 0;
|
||||||
|
|
||||||
|
const [isLoadingExportingToExcel, setIsLoadingExportingToExcel] =
|
||||||
|
useState(false);
|
||||||
|
|
||||||
// Modal hooks
|
// Modal hooks
|
||||||
const filterModal = useModal();
|
const filterModal = useModal();
|
||||||
const deleteModal = useModal();
|
const deleteModal = useModal();
|
||||||
@@ -453,9 +456,12 @@ const TransferToLayingsTable = () => {
|
|||||||
updateFilter('status', '');
|
updateFilter('status', '');
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: add export to excel functionality
|
const exportToExcelHandler = async () => {
|
||||||
const exportToExcelHandler = () => {
|
setIsLoadingExportingToExcel(true);
|
||||||
toast.error('Not implemented yet');
|
|
||||||
|
await TransferToLayingApi.exportToExcel(getTableFilterQueryString());
|
||||||
|
|
||||||
|
setIsLoadingExportingToExcel(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -615,6 +621,7 @@ const TransferToLayingsTable = () => {
|
|||||||
variant='ghost'
|
variant='ghost'
|
||||||
color='none'
|
color='none'
|
||||||
onClick={exportToExcelHandler}
|
onClick={exportToExcelHandler}
|
||||||
|
isLoading={isLoadingExportingToExcel}
|
||||||
className='w-full p-3 justify-start text-sm text-base-content/50 font-semibold text-nowrap'
|
className='w-full p-3 justify-start text-sm text-base-content/50 font-semibold text-nowrap'
|
||||||
>
|
>
|
||||||
<Icon icon='heroicons:table-cells' width={20} height={20} />
|
<Icon icon='heroicons:table-cells' width={20} height={20} />
|
||||||
|
|||||||
Reference in New Issue
Block a user