All files / src/app/student-page/components/class-details ViewTeacher.jsx

0% Statements 0/10
0% Branches 0/10
0% Functions 0/3
0% Lines 0/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123                                                                                                                                                                                                                                                     
import "./ViewTeacher.scss";
import AppBar from "@mui/material/AppBar";
import Box from "@mui/material/Box";
import Toolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
import { Avatar, Divider } from "@mui/material";
import { blue } from "@mui/material/colors";
import { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { _fetchSpecificClassByCode } from "@/store/slices/student/StudentSpecificClass";
import { useParams } from "react-router-dom";
import BasicBreadcrumbs from "@/utils/components/breadcrumbs/basic-breadcrumbs/BasicBreadcrumbs";
 
const ViewTeacher = () => {
    const { specificClassData, isLoading, hasErrors } = useSelector((state) => state.StudentSpecificClass);
    const { classCode } = useParams();
 
    const dispatch = useDispatch();
 
    const breadcrumb = [
        {
            name: "Classes",
            isLink: true,
            path: "/student/classes",
        },
        {
            name: specificClassData?.title,
            isLink: true,
            path: `/student/classes/${classCode}`,
        },
        {
            name: `${specificClassData?.teacher.first_name} ${specificClassData?.teacher.middle_name ?? ""} ${specificClassData?.teacher.last_name}`,
            isLink: false,
        },
    ];
 
    useEffect(() => {
        if (!specificClassData) {
            dispatch(_fetchSpecificClassByCode(classCode));
        }
    }, []);
 
    return (
        <Box>
            <div className="student-view-teacher">
                <div className="settings-item">
                    <div className="item-content">
                        <div className="content-title"></div>
                        <div className="content-text">
                            <Avatar
                                src={`${specificClassData?.teacher?.profile_picture}`}
                                alt={`${specificClassData?.teacher?.first_name?.[0] ?? ""}${specificClassData?.teacher?.last_name?.[0] ?? ""}`}
                                sx={{
                                    width: 75,
                                    height: 75,
                                    margin: "0 auto",
                                    bgcolor: "primary.main",
                                    color: "#fff",
                                }}
                            />
                        </div>
                    </div>
                    <div className="item-actions"></div>
                </div>
                <Divider />
                <div className="settings-item">
                    <div className="item-content">
                        <Typography variant="subtitle2" color="text.secondary">Office Hours:</Typography>
                        <Typography variant="subtitle1" color="text.primary">
                            Location: ---
                            <br />
                            Conference Time: 00:00 AM - 00:00 PM
                        </Typography>
                    </div>
                    <div className="item-actions"></div>
                </div>
                <Divider />
                <div className="settings-item">
                    <div className="item-content">
                        <Typography variant="subtitle2" color="text.secondary">Name:</Typography>
                        <Typography variant="subtitle1" color="text.primary">{`${specificClassData?.teacher.first_name} ${specificClassData?.teacher.middle_name ?? ""} ${specificClassData?.teacher.last_name}`}</Typography>
                    </div>
                    <div className="item-actions"></div>
                </div>
                <Divider />
                <div className="settings-item">
                    <div className="item-content">
                        <Typography variant="subtitle2" color="text.secondary">Role:</Typography>
                        <Typography variant="subtitle1" color="text.primary">Teacher</Typography>
                    </div>
                    <div className="item-actions"></div>
                </div>
                <Divider />
                <div className="settings-item">
                    <div className="item-content">
                        <Typography variant="subtitle2" color="text.secondary">School:</Typography>
                        <Typography variant="subtitle1" color="text.primary">---</Typography>
                    </div>
                    <div className="item-actions"></div>
                </div>
                <Divider />
                <div className="settings-item">
                    <div className="item-content">
                        <Typography variant="subtitle2" color="text.secondary">Email:</Typography>
                        <Typography variant="subtitle1" color="text.primary">{`${specificClassData?.teacher.email}`}</Typography>
                    </div>
                    <div className="item-actions"></div>
                </div>
                <Divider />
                <div className="settings-item">
                    <div className="item-content">
                        <Typography variant="subtitle2" color="text.secondary">Phone number:</Typography>
                        <Typography variant="subtitle1" color="text.primary">---</Typography>
                    </div>
                    <div className="item-actions"></div>
                </div>
            </div>
        </Box>
    );
};
 
export default ViewTeacher;