hensei-web/components/common/MentionTableField/index.tsx
Justin Edmund a4e4328329
Add support for including/excluding items from team filtering (#363)
This PR adds support for including/excluding specific items from team
filtering. Users can use the filter modal to only show teams that
include specific items, only show teams that _don't_ include specific
items, or combine the two to create a very powerful filter.
2023-08-21 20:01:11 -07:00

45 lines
959 B
TypeScript

import TableField from '~components/common/TableField'
import MentionTypeahead from '../MentionTypeahead'
interface Props
extends React.DetailedHTMLProps<
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
> {
label: string
description?: string
placeholder?: string
inclusions: MentionItem[]
exclusions: MentionItem[]
onUpdate: (content: MentionItem[]) => void
}
const MentionTableField = ({
label,
description,
placeholder,
inclusions,
exclusions,
...props
}: Props) => {
return (
<TableField
{...props}
name={props.name || ''}
description={description}
className="mention"
label={label}
>
<MentionTypeahead
label={label}
description={description}
placeholder={placeholder}
inclusions={inclusions}
exclusions={exclusions}
onUpdate={props.onUpdate}
/>
</TableField>
)
}
export default MentionTableField