"use client"; import React from "react"; import { SEARCH_SCOPE } from "@/lib/frontend/search/urlState"; import SearchQueryBox from "@/components/search/form/SearchQueryBox"; import SearchScopeSelect from "@/components/search/form/SearchScopeSelect"; import SearchLimitSelect from "@/components/search/form/SearchLimitSelect"; import SearchSingleBranchCombobox from "@/components/search/form/SearchSingleBranchCombobox"; import SearchMultiBranchPicker from "@/components/search/form/SearchMultiBranchPicker"; import SearchDateRangePicker from "@/components/search/form/SearchDateRangePicker"; import SearchDateFilterChip from "@/components/search/form/SearchDateFilterChip"; import { Alert, AlertTitle, AlertDescription } from "@/components/ui/alert"; import { AlertCircleIcon } from "lucide-react"; export default function SearchForm({ branch, qDraft, onQDraftChange, onSubmit, currentQuery, isSubmitting, isAdminDev, scope, onScopeChange, onSingleBranchChange, availableBranches, branchesStatus, selectedBranches, onToggleBranch, onClearAllBranches, limit, onLimitChange, from, to, onDateRangeChange, validationError, }) { const canSearch = typeof qDraft === "string" && qDraft.trim().length > 0; // RHL-038 UI behavior: // - Single scope shows an extra combobox (branch picker). // - Multi/All does not. // - We animate the combobox container (max-width/max-height/opacity) so the // query block (input + search button) grows/shrinks smoothly. const showSingleBranchCombobox = Boolean( isAdminDev && scope === SEARCH_SCOPE.SINGLE ); const hasDateFilter = Boolean(from || to); return (