Update task creation page layout (#226)

This commit is contained in:
Salih Altun
2024-04-24 17:45:39 +03:00
committed by GitHub
parent 90fbe50579
commit 382505ee75
2 changed files with 25 additions and 6 deletions

View File

@@ -10,13 +10,20 @@ import {
import { SampleCase } from "../types"; import { SampleCase } from "../types";
import { getSampleForInitialFormValues } from "../data/sampleTaskData"; import { getSampleForInitialFormValues } from "../data/sampleTaskData";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
function CreateNewTask() { function CreateNewTask() {
const [selectedCase, setSelectedCase] = useState<SampleCase>("geico"); const [selectedCase, setSelectedCase] = useState<SampleCase>("geico");
const caseInputId = useId(); const caseInputId = useId();
return ( return (
<div className="flex flex-col gap-6 px-6"> <div className="flex flex-col gap-8 max-w-5xl mx-auto">
<div className="flex gap-4 items-center"> <div className="flex gap-4 items-center">
<Label htmlFor={caseInputId} className="whitespace-nowrap"> <Label htmlFor={caseInputId} className="whitespace-nowrap">
Select a sample: Select a sample:
@@ -38,10 +45,21 @@ function CreateNewTask() {
</SelectContent> </SelectContent>
</Select> </Select>
</div> </div>
<CreateNewTaskForm <Card>
key={selectedCase} <CardHeader className="border-b-2">
initialValues={getSampleForInitialFormValues(selectedCase)} <CardTitle className="text-lg">Create a new task</CardTitle>
/> <CardDescription>
Fill out the form below to create a new task. You can select a
sample from above to prefill the form with sample data.
</CardDescription>
</CardHeader>
<CardContent>
<CreateNewTaskForm
key={selectedCase}
initialValues={getSampleForInitialFormValues(selectedCase)}
/>
</CardContent>
</Card>
</div> </div>
); );
} }

View File

@@ -1,4 +1,5 @@
export const urlDescription = "The starting URL for the task."; export const urlDescription =
"The starting URL for the task. This field is required.";
export const webhookCallbackUrlDescription = export const webhookCallbackUrlDescription =
"The URL to call with the results when the task is completed."; "The URL to call with the results when the task is completed.";