"use client"; import React, { useEffect, useState } from "react"; import { FilterSpaces } from "./filterSpaces"; import { ArrowRightIcon } from "@repo/ui/icons"; import Image from "next/image"; import { Switch } from "@repo/ui/shadcn/switch"; import { Label } from "@repo/ui/shadcn/label"; function QueryInput({ initialSpaces, handleSubmit, query, setQuery, }: { initialSpaces?: { id: number; name: string; }[]; mini?: boolean; handleSubmit: ( q: string, spaces: { id: number; name: string }[], proMode: boolean, ) => void; query: string; setQuery: (q: string) => void; }) { const [proMode, setProMode] = useState(false); const [selectedSpaces, setSelectedSpaces] = useState< { id: number; name: string }[] >([]); return (
{/* input and action button */}
{ if (query.trim().length === 0) { return; } handleSubmit(query, selectedSpaces, proMode); setQuery(""); }} >