"use client"; import { useState } from "react"; import { Form } from "@/_types"; import { generate } from "@/app/_actions/generate"; import { Brand } from "./step/brand"; import { Steps } from "./step/list"; import { Industry } from "./step/industry"; import { Description } from "./step/description"; import classNames from "classnames"; import { toast } from "react-toastify"; import Image from "next/image"; export const Generation = () => { const [form, setForm] = useState
({ brand_name: "", display_name: false, description: "", industry: "", style: "", }); const [loading, setLoading] = useState(false); const [result, setResult] = useState(undefined); const handleGenerate = async () => { if (loading) return; setLoading(true); try { const response = await generate(form); setResult(response.data); } catch (err) { toast.error("An error occurred. Please try again later."); } finally { setLoading(false); } }; return (

Start your generation here.

{result && (
Generated logo
)}
); };