diff --git a/web/src/components/MainTable.tsx b/web/src/components/MainTable.tsx index 65e58f7a..d69fc309 100644 --- a/web/src/components/MainTable.tsx +++ b/web/src/components/MainTable.tsx @@ -35,7 +35,7 @@ export function MainTable({}: DashboardPageProps) { weekOfYear: { equals: dashboardStore.calendar.week }, }, }, - { enabled: !!dashboardStore.activeMealBoardPlan }, + { enabled: !!dashboardStore.activeMealBoardPlan?.id }, ); useEffect(() => { diff --git a/web/src/components/pages/dashboard/table/TableContext.tsx b/web/src/components/pages/dashboard/table/TableContext.tsx index 5b47c6aa..8a862854 100644 --- a/web/src/components/pages/dashboard/table/TableContext.tsx +++ b/web/src/components/pages/dashboard/table/TableContext.tsx @@ -16,6 +16,7 @@ import { } from "@dnd-kit/sortable"; import dayjs from "dayjs"; import { useTranslations } from "next-intl"; +import { title } from "process"; import { useSnapshot } from "valtio"; import { CopyTableWeek } from "./CopyTableWeek"; import { TableGroupRow } from "./TableGroupRow"; @@ -26,14 +27,11 @@ interface RenderDayColumnProps { } const RenderDayColumn: React.FC = (props) => { - const t = useTranslations<"Meals">(); const dashboardStore = useSnapshot(DashboardStore); - - const title = t(props.dayKey as keyof Messages["Meals"]); const date = dayjs(dashboardStore.daysThatWeek.at(props.index)).format( "DD.MM", ); - const text = `${title.at(0)?.toUpperCase()}${title.at(1)}. ${date}`; + const text = `${props.dayKey.at(0)?.toUpperCase()}${props.dayKey.at(1)}. ${date}`; return (
@@ -76,9 +74,11 @@ export function TableContext() { />
- {WEEK_DAYS.map((day, index) => ( - - ))} + {WEEK_DAYS.map((day, index) => { + const title = t(day.toUpperCase() as keyof Messages["Meals"]); + + return ; + })}