import { Box, Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography, styled, } from "@mui/material"; import PastEntryCalendar, { Props as PastEntryCalendarProps, } from "./PastEntryCalendar"; import { useCallback, useState } from "react"; import { useTranslation } from "react-i18next"; import { ArrowBack } from "@mui/icons-material"; import PastEntryList from "./PastEntryList"; import { ProjectWithTasks } from "@/app/api/projects"; import { LeaveType } from "@/app/api/timesheets"; import useIsMobile from "@/app/utils/useIsMobile"; import FullscreenModal from "../FullscreenModal"; import MonthlySummary from "./MonthlySummary"; import { HolidaysResult } from "@/app/api/holidays"; import dayjs from "dayjs"; interface Props extends Omit { open: boolean; handleClose: () => void; leaveTypes: LeaveType[]; allProjects: ProjectWithTasks[]; companyHolidays: HolidaysResult[]; } const Indicator = styled(Box)(() => ({ borderRadius: "50%", width: "1rem", height: "1rem", })); const PastEntryCalendarModal: React.FC = ({ handleClose, open, timesheet, leaves, leaveTypes, allProjects, }) => { const { t } = useTranslation("home"); const [selectedDate, setSelectedDate] = useState(""); const [currentMonth, setMonthChange] = useState(dayjs()); const clearDate = useCallback(() => { setSelectedDate(""); }, []); const onClose = useCallback(() => { handleClose(); }, [handleClose]); const content = ( {t("Has timesheet entry")} {t("Has leave entry")} {t("Has both timesheet and leave entry")} {selectedDate ? ( ) : ( )} ); const isMobile = useIsMobile(); return isMobile ? ( {t("Past Entries")} {content} {selectedDate && ( )} ) : ( {t("Past Entries")} {content} {selectedDate && ( )} ); }; export default PastEntryCalendarModal;