import { jsx as _jsx } from "react/jsx-runtime";
import { CalendarEditIcon, CalendarIcon, Text } from '@cube-dev/ui-kit';
import { useRef } from 'react';
import { InstanceTooltipProvider } from './InstanceTooltipProvider';
import { ListMemberButton } from './ListMemberButton';
export function GranularityListMember(props) {
    const { name, title, isCustom, isSelected, isMissing, memberViewType = 'name', onToggle } = props;
    const textRef = useRef(null);
    return (_jsx(InstanceTooltipProvider, { name: name, title: title, overflowRef: isCustom ? textRef : undefined, children: _jsx(ListMemberButton, { icon: isCustom ? _jsx(CalendarEditIcon, {}) : _jsx(CalendarIcon, {}), "data-member": "timeDimension", isSelected: isSelected, mods: { missing: isMissing }, onPress: onToggle, children: _jsx(Text, { ref: textRef, ellipsis: true, children: (memberViewType === 'name' ? name : title) ?? name }) }) }));
}
//# sourceMappingURL=GranularityListMember.js.map