11import { Box , Card , CardContent , Grid , IconButton , Stack , Typography } from '@mui/material' ;
22import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline' ;
3- import { DesignReview } from 'shared' ;
3+ import { DesignReview , TeamType } from 'shared' ;
44import { meetingStartTimePipe } from '../../../utils/pipes' ;
55import ConstructionIcon from '@mui/icons-material/Construction' ;
66import WorkOutlineIcon from '@mui/icons-material/WorkOutline' ;
77import ElectricalServicesIcon from '@mui/icons-material/ElectricalServices' ;
88import TerminalIcon from '@mui/icons-material/Terminal' ;
99import { useState } from 'react' ;
1010import DRCSummaryModal from '../DesignReviewSummaryModal' ;
11+ import { DesignReviewCreateModal } from '../DesignReviewCreateModal' ;
1112
1213export const getTeamTypeIcon = ( teamTypeId : string , isLarge ?: boolean ) => {
1314 const teamIcons : Map < string , JSX . Element > = new Map ( [
@@ -22,13 +23,16 @@ export const getTeamTypeIcon = (teamTypeId: string, isLarge?: boolean) => {
2223interface CalendarDayCardProps {
2324 cardDate : Date ;
2425 events : DesignReview [ ] ;
26+ teamTypes : TeamType [ ] ;
2527}
2628
27- const CalendarDayCard : React . FC < CalendarDayCardProps > = ( { cardDate, events } ) => {
29+ const CalendarDayCard : React . FC < CalendarDayCardProps > = ( { cardDate, events, teamTypes } ) => {
30+ const [ isCreateModalOpen , setIsCreateModalOpen ] = useState ( false ) ;
31+
2832 const DayCardTitle = ( ) => (
2933 < Grid container alignItems = "center" margin = { 0 } padding = { 0 } >
3034 < Grid item >
31- < IconButton >
35+ < IconButton onClick = { ( ) => setIsCreateModalOpen ( true ) } >
3236 < AddCircleOutlineIcon fontSize = "small" />
3337 </ IconButton >
3438 </ Grid >
@@ -74,6 +78,13 @@ const CalendarDayCard: React.FC<CalendarDayCardProps> = ({ cardDate, events }) =
7478
7579 return (
7680 < Card sx = { { borderRadius : 2 , minWidth : 150 , maxWidth : 150 , minHeight : 90 , maxHeight : 90 } } >
81+ < DesignReviewCreateModal
82+ showModal = { isCreateModalOpen }
83+ handleClose = { ( ) => {
84+ setIsCreateModalOpen ( false ) ;
85+ } }
86+ teamTypes = { teamTypes }
87+ />
7788 < CardContent sx = { { padding : 0 } } >
7889 < DayCardTitle />
7990 { events . length < 3 ? (
0 commit comments