diff --git a/app/components/ui/CalculatorInput.tsx b/app/components/ui/CalculatorInput.tsx index ca06b435..5a561985 100644 --- a/app/components/ui/CalculatorInput.tsx +++ b/app/components/ui/CalculatorInput.tsx @@ -22,8 +22,10 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; +type View = "form" | "loading" | "dashboard"; + const CalculatorInput = () => { - const [view, setView] = useState("form"); + const [view, setView] = useState("form"); const [data, setData] = useState(null); const searchParams = useSearchParams(); @@ -227,14 +229,18 @@ const CalculatorInput = () => { ); - } else if (view === "loading") { + } + + if (view === "loading") { return (
); - } else if (view === "dashboard") { - return ; + } + + if (view === "dashboard" && data) { + return ; } };