@@ -3,25 +3,22 @@ import { InformationCircleIcon } from "@heroicons/react/20/solid";
33import { Form , useNavigation , useSubmit } from "@remix-run/react" ;
44import { ActionFunctionArgs , json } from "@remix-run/server-runtime" ;
55import { Waitpoint } from "@trigger.dev/database" ;
6+ import { motion } from "framer-motion" ;
67import { useCallback , useRef } from "react" ;
78import { z } from "zod" ;
9+ import { AnimatedHourglassIcon } from "~/assets/icons/AnimatedHourglassIcon" ;
810import { CodeBlock } from "~/components/code/CodeBlock" ;
9- import { InlineCode } from "~/components/code/InlineCode" ;
1011import { JSONEditor } from "~/components/code/JSONEditor" ;
1112import { Button } from "~/components/primitives/Buttons" ;
12- import { Callout } from "~/components/primitives/Callout" ;
13- import { Fieldset } from "~/components/primitives/Fieldset" ;
14- import { Header3 } from "~/components/primitives/Headers" ;
15- import { InputGroup } from "~/components/primitives/InputGroup" ;
16- import { Label } from "~/components/primitives/Label" ;
13+ import { DateTime } from "~/components/primitives/DateTime" ;
1714import { Paragraph } from "~/components/primitives/Paragraph" ;
15+ import { LiveCountdown } from "~/components/runs/v3/LiveTimer" ;
1816import { prisma } from "~/db.server" ;
1917import { useOrganization } from "~/hooks/useOrganizations" ;
2018import { useProject } from "~/hooks/useProject" ;
2119import { redirectWithErrorMessage , redirectWithSuccessMessage } from "~/models/message.server" ;
2220import { logger } from "~/services/logger.server" ;
2321import { requireUserId } from "~/services/session.server" ;
24- import { cn } from "~/utils/cn" ;
2522import { ProjectParamSchema , v3SchedulesPath } from "~/utils/pathBuilder" ;
2623import { UpsertSchedule } from "~/v3/schedules" ;
2724import { UpsertTaskScheduleService } from "~/v3/services/upsertTaskSchedule.server" ;
@@ -118,6 +115,8 @@ export function CompleteWaitpointForm({ waitpoint }: { waitpoint: FormWaitpoint
118115 [ currentJson ]
119116 ) ;
120117
118+ const endTime = new Date ( Date . now ( ) + 60_000 * 113 ) ;
119+
121120 return (
122121 < div className = "space-y-3" >
123122 < Form
@@ -174,6 +173,43 @@ await wait.completeToken<YourType>(tokenId,
174173);` }
175174 showLineNumbers = { false }
176175 />
176+ < Form
177+ action = { formAction }
178+ method = "post"
179+ onSubmit = { ( e ) => submitForm ( e ) }
180+ className = "grid h-full max-h-full grid-rows-[2.5rem_1fr_2.5rem] overflow-hidden rounded-md border border-grid-bright"
181+ >
182+ < div className = "mx-3 flex items-center" >
183+ < Paragraph variant = "small/bright" > Manually skip this waitpoint</ Paragraph >
184+ </ div >
185+ < div className = "border-t border-grid-dimmed" >
186+ < input type = "hidden" name = "type" value = { waitpoint . type } />
187+ < div className = "flex flex-wrap items-center justify-between gap-1 p-2 text-sm tabular-nums" >
188+ < div className = "flex items-center gap-1" >
189+ < AnimatedHourglassIcon
190+ className = "text-dimmed-dimmed size-4"
191+ delay = { ( endTime . getMilliseconds ( ) - Date . now ( ) ) / 1000 }
192+ />
193+ < span className = "mt-0.5 " >
194+ < LiveCountdown endTime = { endTime } />
195+ </ span >
196+ </ div >
197+ < DateTime date = { endTime } />
198+ </ div >
199+ </ div >
200+ < div className = "px-2" >
201+ < div className = "mb-2 flex items-center justify-end gap-2 border-t border-grid-dimmed pt-2" >
202+ < Button
203+ variant = "secondary/small"
204+ type = "submit"
205+ disabled = { isLoading }
206+ LeadingIcon = { isLoading ? "spinner" : undefined }
207+ >
208+ { isLoading ? "Completing…" : "Skip waitpoint" }
209+ </ Button >
210+ </ div >
211+ </ div >
212+ </ Form >
177213 </ div >
178214 ) ;
179215}
0 commit comments