Commit dec84279 authored by janithgamage1.ed's avatar janithgamage1.ed

fix: update

Desc : update project
parent 5717066a
export interface StatusType {
id: number
code: string
description: string
}
// ==============================|| DATA - Status ||============================== //
const status: readonly StatusType[] = [
{ id: 1, code: "Active", description: "Active" },
{ id: 2, code: "New", description: "New" },
{ id: 3, code: "Pending", description: "Pending" },
{ id: 4, code: "Hold", description: "Hold" },
{ id: 5, code: "Rejected", description: "Rejected" },
];
export default status;
...@@ -28,49 +28,13 @@ import { MoreOutlined } from '@ant-design/icons'; ...@@ -28,49 +28,13 @@ import { MoreOutlined } from '@ant-design/icons';
import Avatar from 'components/@extended/Avatar'; import Avatar from 'components/@extended/Avatar';
import curriculumLevels from 'data/curriculumLevels'; import curriculumLevels from 'data/curriculumLevels';
import CurriculumPreview from './CurriculumPreview'; import CurriculumPreview from './CurriculumPreview';
import { curriculumType } from 'types/curriculum';
// types // types
export interface curriculumCardProps {
_id: number | string | undefined;
curriculumCode: string;
curriculumLevel: number;
curriculumName: string;
curriculumDescription: string;
curriculumImage: string;
tutorials?: tutorialItemProps[];
status?: number;
createdBy?: string;
updatedBy?: string;
createdAt?: Date;
updatedAt?: Date;
}
export interface tutorialItemProps {
_id: number | string | undefined;
tutorialCode: string;
tutorialTitle: string;
tutorialDescription: string;
tutorialImage: string;
status?: number;
createdBy?: string;
updatedBy?: string;
createdAt?: Date;
updatedAt?: Date;
taskItems?: taskItemProps[]
}
export interface taskItemProps {
_id: number | string | undefined;
title: string;
description: string;
howToDo: string;
referenceImage: string;
referenceVideo: string;
}
// ==============================|| CURRICULUM - CARD ||============================== // // ==============================|| CURRICULUM - CARD ||============================== //
const CurriculumCard = ({ curriculum }: { curriculum: curriculumCardProps }) => { const CurriculumCard = ({ curriculum }: { curriculum: curriculumType }) => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const handleClickOpen = () => { const handleClickOpen = () => {
...@@ -105,10 +69,10 @@ const CurriculumCard = ({ curriculum }: { curriculum: curriculumCardProps }) => ...@@ -105,10 +69,10 @@ const CurriculumCard = ({ curriculum }: { curriculum: curriculumCardProps }) =>
} }
> >
<ListItemAvatar> <ListItemAvatar>
<Avatar alt={curriculum.curriculumName!} src={curriculum.curriculumImage!} /> <Avatar alt={curriculum.curriculumTitle!} src={curriculum.curriculumImage!} />
</ListItemAvatar> </ListItemAvatar>
<ListItemText <ListItemText
primary={<Typography variant="subtitle1">{curriculum.curriculumName}</Typography>} primary={<Typography variant="subtitle1">{curriculum.curriculumTitle}</Typography>}
secondary={ secondary={
<Typography variant="caption" color="secondary"> <Typography variant="caption" color="secondary">
{curriculumLevels.find(level => level.id === curriculum.curriculumLevel)?.description || ""} {curriculumLevels.find(level => level.id === curriculum.curriculumLevel)?.description || ""}
...@@ -137,7 +101,7 @@ const CurriculumCard = ({ curriculum }: { curriculum: curriculumCardProps }) => ...@@ -137,7 +101,7 @@ const CurriculumCard = ({ curriculum }: { curriculum: curriculumCardProps }) =>
> >
<MenuItem sx={{ a: { textDecoration: 'none', color: 'inherit' } }}> <MenuItem sx={{ a: { textDecoration: 'none', color: 'inherit' } }}>
<PDFDownloadLink <PDFDownloadLink
document={<></>} fileName={`${curriculum.curriculumCode}-${curriculum.curriculumName}.pdf`} document={<></>} fileName={`${curriculum.curriculumCode}-${curriculum.curriculumTitle}.pdf`}
// document={<ListSmallCard customer={customer} />} fileName={`Customer-${customer.fatherName}.pdf`} // document={<ListSmallCard customer={customer} />} fileName={`Customer-${customer.fatherName}.pdf`}
> >
Export PDF Export PDF
......
...@@ -33,50 +33,13 @@ import SimpleBar from 'components/third-party/SimpleBar'; ...@@ -33,50 +33,13 @@ import SimpleBar from 'components/third-party/SimpleBar';
// assets // assets
import { DownloadOutlined, TagOutlined } from '@ant-design/icons'; import { DownloadOutlined, TagOutlined } from '@ant-design/icons';
import curriculumLevels from 'data/curriculumLevels'; import curriculumLevels from 'data/curriculumLevels';
import { curriculumType } from 'types/curriculum';
// types // types
export interface curriculumCardProps {
_id: number | string | undefined;
curriculumCode: string;
curriculumLevel: number;
curriculumName: string;
curriculumDescription: string;
curriculumImage: string;
tutorials?: tutorialItemProps[];
status?: number;
createdBy?: string;
updatedBy?: string;
createdAt?: Date;
updatedAt?: Date;
}
export interface tutorialItemProps {
_id: number | string | undefined;
tutorialCode: string;
tutorialTitle: string;
tutorialDescription: string;
tutorialImage: string;
status?: number;
createdBy?: string;
updatedBy?: string;
createdAt?: Date;
updatedAt?: Date;
taskItems?: taskItemProps[]
}
export interface taskItemProps {
_id: number | string | undefined;
title: string;
description: string;
howToDo: string;
referenceImage: string;
referenceVideo: string;
}
// ==============================|| Curriculum - CARD PREVIEW ||============================== // // ==============================|| Curriculum - CARD PREVIEW ||============================== //
export default function CurriculumPreview({ curriculum, open, onClose }: { curriculum: curriculumCardProps; open: boolean; onClose: () => void }) { export default function CurriculumPreview({ curriculum, open, onClose }: { curriculum: curriculumType; open: boolean; onClose: () => void }) {
const theme = useTheme(); const theme = useTheme();
const [expanded, setExpanded] = useState<string | false>('panel0'); const [expanded, setExpanded] = useState<string | false>('panel0');
...@@ -104,7 +67,7 @@ export default function CurriculumPreview({ curriculum, open, onClose }: { curri ...@@ -104,7 +67,7 @@ export default function CurriculumPreview({ curriculum, open, onClose }: { curri
<Stack direction="row" alignItems="center" justifyContent="center" spacing={0}> <Stack direction="row" alignItems="center" justifyContent="center" spacing={0}>
<Tooltip title="Export"> <Tooltip title="Export">
<PDFDownloadLink <PDFDownloadLink
document={<></>} fileName={`${curriculum.curriculumCode}-${curriculum.curriculumName}.pdf`} document={<></>} fileName={`${curriculum.curriculumCode}-${curriculum.curriculumTitle}.pdf`}
// document={<ListCard customer={customer} />} fileName={`Customer-${customer.fatherName}.pdf`} // document={<ListCard customer={customer} />} fileName={`Customer-${customer.fatherName}.pdf`}
> >
<IconButton color="secondary"> <IconButton color="secondary">
...@@ -126,10 +89,10 @@ export default function CurriculumPreview({ curriculum, open, onClose }: { curri ...@@ -126,10 +89,10 @@ export default function CurriculumPreview({ curriculum, open, onClose }: { curri
} }
> >
<ListItemAvatar sx={{ mr: 0.75 }}> <ListItemAvatar sx={{ mr: 0.75 }}>
<Avatar alt={curriculum.curriculumName} size="lg" src={curriculum.curriculumImage} /> <Avatar alt={curriculum.curriculumTitle} size="lg" src={curriculum.curriculumImage} />
</ListItemAvatar> </ListItemAvatar>
<ListItemText <ListItemText
primary={<Typography variant="h5">{curriculum.curriculumName}</Typography>} primary={<Typography variant="h5">{curriculum.curriculumTitle}</Typography>}
secondary={<Typography color="secondary"> {curriculumLevels.find(level => level.id === curriculum.curriculumLevel)?.description || ""}</Typography>} secondary={<Typography color="secondary"> {curriculumLevels.find(level => level.id === curriculum.curriculumLevel)?.description || ""}</Typography>}
/> />
</ListItem> </ListItem>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment