Skip to content

Commit

Permalink
Merge pull request #276 from Aar-if/workspace
Browse files Browse the repository at this point in the history
Issue #2242 feat: Course Editor integration in Admin app
  • Loading branch information
itsvick authored Oct 23, 2024
2 parents 93c1453 + 6a02ec2 commit 662446d
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions src/pages/importCsv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const ImportCsv = () => {
const tstore = taxonomyStore();
const { subject } = router.query;
const { t } = useTranslation();
const [subjectDetails, setSubjectDetails] = useState<any | null>(null);

const [open, setOpen] = useState(false);
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [loading, setLoading] = useState(true);
Expand All @@ -69,26 +69,6 @@ const ImportCsv = () => {
const isSmallScreen = useMediaQuery(theme.breakpoints.down("sm"));
const setResources = taxonomyStore((state) => state.setResources);

useEffect(() => {
const fetchData = async () => {
// Simulate data fetching
setTimeout(() => {
if (typeof subject === "string") {
const card = cardData.find((card) => card.subjects.includes(subject));
if (card) {
setSubjectDetails({
...card,
subject,
});
}
}
setLoading(false);
}, 1000); // Simulated loading time
};

fetchData();
}, [subject]);

const fetchCourseDetails = useCallback(async () => {
try {
setLoading(true);
Expand Down Expand Up @@ -156,7 +136,6 @@ const ImportCsv = () => {
});
setUserProjectDetails(userProjectDetailsResponse?.result?.tasks);
if (userProjectDetails?.length) {

}
setLoading(false);
} catch (error) {
Expand Down Expand Up @@ -193,13 +172,12 @@ const ImportCsv = () => {

const handleDownloadCSV = () => {
const link = document.createElement("a");
link.href = "/Sample.csv";
link.href = "/Sample.csv";
link.download = "Sample.csv";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};


const handleUpload = async () => {
if (selectedFile) {
Expand Down

0 comments on commit 662446d

Please sign in to comment.