I see this error with the app, reported by NextJS, please fix it. The er

This commit is contained in:
Leon Serfaty G
2025-07-18 07:35:38 +00:00
parent 0a8cee14cc
commit 7c0ce2cdbb
+4 -8
View File
@@ -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 <Button type="submit">Save Changes</Button>;
}
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<Flow | null>(null);
const [isLoading, setIsLoading] = useState(true);