diff --git a/apps/frontend/app/routes/_dashboard.tsx b/apps/frontend/app/routes/_dashboard.tsx index 2f461f71d2..4985db0f91 100644 --- a/apps/frontend/app/routes/_dashboard.tsx +++ b/apps/frontend/app/routes/_dashboard.tsx @@ -933,12 +933,12 @@ const Footer = () => { ); }; -const WATCH_TIMES = [ - "Just Completed Now", - "I don't remember", - "Custom Date", - "Just Started It", -] as const; +enum WatchTimes { + JustCompletedNow = "Just Completed Now", + IDontRemember = "I don't remember", + CustomDate = "Custom Date", + JustStartedIt = "Just Started It", +} const MetadataProgressUpdateForm = ({ closeMetadataProgressUpdateModal, @@ -1121,8 +1121,8 @@ const MetadataNewProgressUpdateForm = ({ const [selectedDate, setSelectedDate] = useState( new Date(), ); - const [watchTime, setWatchTime] = useState<(typeof WATCH_TIMES)[number]>( - WATCH_TIMES[0], + const [watchTime, setWatchTime] = useState( + WatchTimes.JustCompletedNow, ); const lastProviderWatchedOn = history[0]?.providerWatchedOn; const watchProviders = useGetWatchProviders(metadataDetails.lot); @@ -1133,17 +1133,17 @@ const MetadataNewProgressUpdateForm = ({ onSubmit={onSubmit} action={withQuery($path("/actions"), { intent: - watchTime === WATCH_TIMES[3] + watchTime === WatchTimes.JustStartedIt ? "individualProgressUpdate" : "progressUpdate", })} > {[ ...Object.entries(metadataToUpdate), - watchTime !== WATCH_TIMES[3] + watchTime !== WatchTimes.JustStartedIt ? ["metadataLot", metadataDetails.lot] : undefined, - watchTime === WATCH_TIMES[3] ? ["progress", "0"] : undefined, + watchTime === WatchTimes.JustStartedIt ? ["progress", "0"] : undefined, selectedDate ? ["date", formatDateToNaiveDate(selectedDate)] : undefined, @@ -1308,28 +1308,33 @@ const MetadataNewProgressUpdateForm = ({ ) : null} ) : null} -