import React, { useState, useMemo, useCallback } from "react"; import _ from "lodash"; interface IFilterOptionProps { checked: boolean; text: string; onChange: (checked: boolean) => void; ["data-testid"]?: string; } const FilterOption = (props: IFilterOptionProps) => { const [checked, setChecked] = useState(props.checked); const id = useMemo(() => _.uniqueId("filter-option-"), []); const onChange = useCallback(() => { setChecked(!checked); props.onChange(!checked); }, [checked]); const testId = props["data-testid"] || `honeyui-filter-option-${id}`; return (