"use client"
import type { ComponentProps } from "react"
import { cn } from "@/lib/utils"
import { Button } from "@/registry/new-york/ui/button"
export type SuggestionsProps = ComponentProps<"div">
export const Suggestions = ({
className,
children,
...props
}: SuggestionsProps) => (
<div className="w-full overflow-x-auto whitespace-nowrap" {...props}>
<div className={cn("flex w-max flex-nowrap items-center gap-2", className)}>
{children}
</div>
</div>
)
export type SuggestionProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
suggestion: string
onClick?: (suggestion: string) => void
}
export const Suggestion = ({
suggestion,
onClick,
className,
variant = "outline",
size = "sm",
children,
...props
}: SuggestionProps) => {
const handleClick = () => {
onClick?.(suggestion)
}
return (
<Button
className={cn("rounded-full px-4", className)}
onPress={handleClick}
size={size}
type="button"
variant={variant}
{...props}
>
{children || suggestion}
</Button>
)
}