import React, { forwardRef } from 'react' import { c } from '../../translations/LibraryTranslationService' import styles from './_filter.module.scss' import Button from '../Button/Button' import TrimText from '../TrimText/TrimText' import { getPlaceholder } from './exposedFilter-helper' import { type TooltipProps } from '../Tooltip/Tooltip' //lableProps is the props for the label of the filter. type LabelProps = { labelName: string placeholder?: string useTrimForLabel?: boolean } //Tagview is the view of the tags in the filter. type TagProps = { tags: string[] useTrimForTags?: boolean truncateTagIndex?: number truncatedTagWidth?: number withMaxWidthOptionContainer?: boolean hasMore?: boolean totalCount?: number } type ExposedFilterShellProps = { label: LabelProps disabled?: boolean disabledTooltip?: Omit isActive: boolean tagView: TagProps onMainClick: () => void onClear?: () => void } const ExposedFilterShell = forwardRef( ( { label, disabled = false, disabledTooltip, isActive, tagView = { tags: [], truncateTagIndex: -1, truncatedTagWidth: 0, withMaxWidthOptionContainer: false, hasMore: false, totalCount: 1, useTrimForTags: false, }, onMainClick, onClear, }, ref, ) => { return (
{isActive && onClear ? ( ) : null}
) }, ) export default ExposedFilterShell