'use client' import { XIcon } from 'lucide-react' import { useEffect, useId, useRef, useState, type KeyboardEvent, type ReactNode } from 'react' import { Button } from '@/components/ui/button' import { Popover, PopoverAnchor, PopoverContent } from '@/components/ui/Popover' import type { CampaignListOmniboxChip, CampaignListOmniboxSuggestion, } from '@/lib/campaignListOmnibox' import { cn } from '@/lib/utils' export type CampaignListOmniboxProps = { id?: string label: string placeholder: string chips: readonly CampaignListOmniboxChip[] suggestions: readonly CampaignListOmniboxSuggestion[] query: string onQueryChange: (query: string) => void onSelectSuggestion: (suggestionId: string) => void onRemoveChip: (chipId: string) => void /** Free-text commit (Enter with no arrow selection / default). Domain owns id scheme. */ onCommitQuery?: (query: string) => void onClearAll?: () => void isPending?: boolean /** Domain controls beside the bar (e.g. save bookmark). */ trailing?: ReactNode /** * C100: below `md` the trailing cluster (column picker, save bookmark) is * hidden — B184 already owns the mobile bar chrome (borderless field, * circle-X clear), and the page registers its own header controls instead. * `md:` restores the trailing cluster beside the framed desktop field. */ edgeToEdge?: boolean } /** * B184 — the mobile sticky bar. Applied by every list to its own `