"use client"; import { useState } from "react"; import HeroInputSubmitButton from "@/components/app/(home)/sections/hero-input/Button/Button"; interface SidebarQuickInputProps { onSubmit: (url: string) => void; disabled?: boolean; } export default function SidebarQuickInput({ onSubmit, disabled = false }: SidebarQuickInputProps) { const [url, setUrl] = useState(""); const handleSubmit = (e?: React.FormEvent) => { if (e) e.preventDefault(); if (!url.trim() || disabled) return; onSubmit(url.trim()); setUrl(""); }; return (
setUrl(e.target.value)} onKeyDown={(e) => { if (e.key === "Enter") { e.preventDefault(); handleSubmit(); } }} />
0} />
); }