mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 05:22:02 +00:00
feat: implement export to excel
This commit is contained in:
@@ -183,6 +183,9 @@ const TransferToLayingsTable = () => {
|
||||
|
||||
const isFilterActive = filterCount > 0;
|
||||
|
||||
const [isLoadingExportingToExcel, setIsLoadingExportingToExcel] =
|
||||
useState(false);
|
||||
|
||||
// Modal hooks
|
||||
const filterModal = useModal();
|
||||
const deleteModal = useModal();
|
||||
@@ -453,9 +456,12 @@ const TransferToLayingsTable = () => {
|
||||
updateFilter('status', '');
|
||||
};
|
||||
|
||||
// TODO: add export to excel functionality
|
||||
const exportToExcelHandler = () => {
|
||||
toast.error('Not implemented yet');
|
||||
const exportToExcelHandler = async () => {
|
||||
setIsLoadingExportingToExcel(true);
|
||||
|
||||
await TransferToLayingApi.exportToExcel(getTableFilterQueryString());
|
||||
|
||||
setIsLoadingExportingToExcel(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -615,6 +621,7 @@ const TransferToLayingsTable = () => {
|
||||
variant='ghost'
|
||||
color='none'
|
||||
onClick={exportToExcelHandler}
|
||||
isLoading={isLoadingExportingToExcel}
|
||||
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} />
|
||||
|
||||
Reference in New Issue
Block a user