"use client" import * as React from "react" import { Button } from "../ui/button" import { Popover, PopoverAnchor, PopoverContent } from "../ui/popover" import { cn } from "../../lib/utils" export interface TableSearchRecentsPopoverProps { open: boolean onOpenChange: (open: boolean) => void items: string[] onSelect: (query: string) => void onClear?: () => void anchor: React.ReactNode title?: string clearLabel?: string className?: string } export function TableSearchRecentsPopover({ open, onOpenChange, items, onSelect, onClear, anchor, title = "Recent searches", clearLabel = "Clear", className, }: TableSearchRecentsPopoverProps) { const headingId = React.useId() if (items.length === 0) { return <>{anchor} } return ( {anchor} e.preventDefault()} >

{title}

{onClear ? ( ) : null}