"use client"; import { ArrowRightIcon } from "@repo/ui/icons"; import Image from "next/image"; import React, { useState } from "react"; function QueryInput({ initialSpaces, initialQuery = "", disabled = false, className, mini = false, handleSubmit, }: { initialQuery?: string; initialSpaces?: { id: number; name: string; }[]; disabled?: boolean; className?: string; mini?: boolean; handleSubmit: (q: string, spaces: { id: number; name: string }[]) => void; }) { const [q, setQ] = useState(initialQuery); const [selectedSpaces, setSelectedSpaces] = useState< { id: number; name: string }[] >([]); return (
{/* input and action button */}
{ if (q.trim().length === 0) { return; } handleSubmit(q, selectedSpaces); setQ(""); }} className="flex gap-4 p-3" >