11import { useMemo } from "react" ;
22import { format , isToday } from "date-fns" ;
33import { AgendaDiv } from "../styles/styles" ;
4- import { ProcessedEvent } from "../types" ;
4+ import { DefaultResource , ProcessedEvent } from "../types" ;
55import useStore from "../hooks/useStore" ;
66import { Typography } from "@mui/material" ;
77import { filterTodayAgendaEvents , isTimeZonedToday } from "../helpers/generals" ;
@@ -10,9 +10,10 @@ import EmptyAgenda from "../components/events/EmptyAgenda";
1010
1111type Props = {
1212 daysList : Date [ ] ;
13+ resource ?: DefaultResource ;
1314 events : ProcessedEvent [ ] ;
1415} ;
15- const WeekAgenda = ( { daysList, events } : Props ) => {
16+ const WeekAgenda = ( { daysList, resource , events } : Props ) => {
1617 const { week, handleGotoDay, locale, timeZone, translations, alwaysShowAgendaDays } = useStore ( ) ;
1718 const { disableGoToDay, headRenderer } = week ! ;
1819
@@ -36,7 +37,7 @@ const WeekAgenda = ({ daysList, events }: Props) => {
3637 < div key = { i } className = { `rs__agenda_row ${ isToday ( day ) ? "rs__today_cell" : "" } ` } >
3738 < div className = "rs__cell rs__agenda__cell" >
3839 { typeof headRenderer === "function" ? (
39- < div > { headRenderer ( day ) } </ div >
40+ < div > { headRenderer ( { day, events , resource } ) } </ div >
4041 ) : (
4142 < Typography
4243 sx = { { fontWeight : today ? "bold" : "inherit" } }
0 commit comments