Added initial Excel changes

This commit is contained in:
Joao Ramos
2024-08-15 14:56:14 +01:00
parent e84cc8ddd8
commit 1950d5f15d
8 changed files with 590 additions and 17 deletions

View File

@@ -18,6 +18,7 @@ interface Props {
reload?: Function;
allowArchive?: boolean;
allowUnarchive?: boolean;
allowExcelDownload?: boolean;
}
export default function AssignmentCard({
@@ -35,10 +36,12 @@ export default function AssignmentCard({
reload,
allowArchive,
allowUnarchive,
allowExcelDownload,
}: Assignment & Props) {
const {users} = useUsers();
const renderPdfIcon = usePDFDownload("assignments");
const renderExcelIcon = usePDFDownload("assignments", "excel");
const renderArchiveIcon = useAssignmentArchive(id, reload);
const renderUnarchiveIcon = useAssignmentUnarchive(id, reload);
@@ -63,6 +66,7 @@ export default function AssignmentCard({
<h3 className="text-xl font-semibold">{name}</h3>
<div className="flex gap-2">
{allowDownload && renderPdfIcon(id, "text-mti-gray-dim", "text-mti-gray-dim")}
{allowExcelDownload && renderExcelIcon(id, "text-mti-gray-dim", "text-mti-gray-dim")}
{allowArchive && !archived && renderArchiveIcon("text-mti-gray-dim", "text-mti-gray-dim")}
{allowUnarchive && archived && renderUnarchiveIcon("text-mti-gray-dim", "text-mti-gray-dim")}
</div>

View File

@@ -264,6 +264,7 @@ export default function CorporateDashboard({user}: Props) {
allowDownload
reload={reloadAssignments}
allowArchive
allowExcelDownload
/>
))}
</div>
@@ -279,6 +280,7 @@ export default function CorporateDashboard({user}: Props) {
allowDownload
reload={reloadAssignments}
allowUnarchive
allowExcelDownload
/>
))}
</div>