Skip to content

Commit

Permalink
Add statuses for export page
Browse files Browse the repository at this point in the history
  • Loading branch information
smartspot2 committed Feb 15, 2024
1 parent 15ba220 commit 99027ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions csm_web/frontend/src/components/data_export/DataExport.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
import React, { useState } from "react";
import { useProfiles } from "../../utils/queries/base";
import { Role } from "../../utils/types";
import LoadingSpinner from "../LoadingSpinner";
import { ExportType } from "./DataExportTypes";
import { ExportPage } from "./ExportPage";
import { ExportSelector } from "./ExportSelector";

export const DataExport = () => {
const [dataExportType, setDataExportType] = useState<ExportType | null>(null);
const { data: profiles, isSuccess: profilesLoaded, isError: profilesError } = useProfiles();

if (profilesError) {
return <b>Error loading user profiles.</b>;
} else if (!profilesLoaded) {
return <LoadingSpinner className="spinner-centered" />;
} else if (profilesLoaded && !profiles.some(profile => profile.role === Role.COORDINATOR)) {
return <b>Permission denied; you are not a coordinator for any course.</b>;
}

return (
<div className="data-export-container">
Expand Down

0 comments on commit 99027ba

Please sign in to comment.