import { defineWebComponent } from './define'; import { ChatScopePicker } from '../components/chat-scope-picker'; import type { SearchFilters } from '../types'; interface Props extends Record { /** Authors to offer as scope filters. Set as a JS property. */ availableAuthors: string[]; /** Tags to offer as scope filters. Set as a JS property. */ availableTags: string[]; /** The label shown on the trigger for the active scope. */ currentLabel?: string; } /** Events fired by ``. */ interface Events { /** A scope was chosen (`undefined` filters = "All Content"). */ 'kc-scope-change': { filters: SearchFilters | undefined }; } /** * `` — a dropdown to scope a chat by author or tag. * Options via `available-authors`/`available-tags` properties; emits * `kc-scope-change`. */ defineWebComponent('kc-scope-picker', { availableAuthors: [], availableTags: [], currentLabel: 'All Content', }, (props, { dispatch }) => ( dispatch('kc-scope-change', { filters })} /> ));