import { splitProps, Show, For } from 'solid-js'; import { cn } from '../utils/cn'; import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem } from '../ui/dropdown'; import { Button } from '../ui/button'; import type { SearchFilters } from '../types'; export interface ChatScopePickerProps { currentLabel: string; onScopeChange: (filters: SearchFilters | undefined) => void; availableAuthors?: string[]; availableTags?: string[]; class?: string; } export function ChatScopePicker(props: ChatScopePickerProps) { const [local] = splitProps(props, ['currentLabel', 'onScopeChange', 'availableAuthors', 'availableTags', 'class']); return ( ( )} /> local.onScopeChange(undefined)}>All Content
Authors
{(author) => ( local.onScopeChange({ authors: [author] })}>{author} )}
Tags
{(tag) => ( local.onScopeChange({ tags: [tag] })}>{tag} )}
); }