Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Feb 18, 2024
1 parent 7cac048 commit 767f3d2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions web/src/components/pages/dashboard/table/CopyTableWeek.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { MyPopover } from "@/components/elements/MyPopover";
import { SWITCH_DATE_WEEKLY_MEAL_GRPOUP_ADMIN } from "@/documents/mutation/dashboard";
import { useGqlMutation } from "@/fetcher";
import { useRouter } from "@/navigation";
import { DashboardStore } from "@/store/DashboardStore";
import { TableStore } from "@/store/TableStore";
import { catchErrorAlerts } from "@/utils/helpers/clientUtils";
import { Button, Card, Input } from "@nextui-org/react";
import { AiTwotoneCopy } from "@react-icons/all-files/ai/AiTwotoneCopy";
import dayjs from "dayjs";
import { useTranslations } from "next-intl";
import React, { FormEvent, useEffect, useState } from "react";
import { useSnapshot } from "valtio";
Expand All @@ -15,14 +15,14 @@ interface CopyTableWeekProps {}

export const CopyTableWeek: React.FC<CopyTableWeekProps> = ({}) => {
const t = useTranslations<"Meals">();
const router = useRouter();

const dashboardStore = useSnapshot(DashboardStore);
const [date, setDate] = useState<string>(dashboardStore.daysThatWeek[0]);
const [isOpen, setIsOpen] = useState<boolean>(false);
const { mutateAsync } = useGqlMutation(SWITCH_DATE_WEEKLY_MEAL_GRPOUP_ADMIN);

useEffect(() => {
setDate(dashboardStore.daysThatWeek[0]);
setDate(dayjs(dashboardStore.daysThatWeek[0]).format("YYYY-MM-DD"));
}, [dashboardStore.daysThatWeek]);

const onSubmit = async (e: FormEvent<HTMLFormElement>) => {
Expand Down Expand Up @@ -61,7 +61,6 @@ export const CopyTableWeek: React.FC<CopyTableWeekProps> = ({}) => {
type="date"
label={t("WEEK")}
labelPlacement="outside-left"
defaultValue={"2014-02-09"}
required
size="sm"
value={date}
Expand Down

0 comments on commit 767f3d2

Please sign in to comment.