diff --git a/src/app/admin/flows/[id]/page.tsx b/src/app/admin/flows/[id]/page.tsx index 249e643..3d7fae2 100644 --- a/src/app/admin/flows/[id]/page.tsx +++ b/src/app/admin/flows/[id]/page.tsx @@ -1,9 +1,8 @@ 'use client'; -import { useEffect, useState } from 'react'; -import { useActionState } from 'react'; -import { useRouter } from 'next/navigation'; +import { useEffect, useState, useActionState } from 'react'; +import { useRouter, useParams } from 'next/navigation'; import { getFlow, saveFlow, type Flow } from '@/lib/actions/flows'; import { Card, CardContent, CardHeader, CardTitle, CardDescription, CardFooter } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; @@ -13,10 +12,6 @@ import { Button } from '@/components/ui/button'; import { useToast } from '@/hooks/use-toast'; import { Alert, AlertDescription } from '@/components/ui/alert'; -type FlowFormPageProps = { - params: { id: string }; -}; - function SubmitButton() { // useFormStatus is not used here because we are not in a form, but we can simulate the pending state // from the formAction. For a real app, you might use the pending state from useFormStatus. @@ -24,7 +19,8 @@ function SubmitButton() { return ; } -export default function FlowFormPage({ params }: FlowFormPageProps) { +export default function FlowFormPage() { + const params = useParams<{ id: string }>(); const [state, formAction] = useActionState(saveFlow, { success: false, message: '', errors: null }); const [flow, setFlow] = useState(null); const [isLoading, setIsLoading] = useState(true);