import { jsx } from 'react/jsx-runtime';
import classNames from '../../_virtual/index.js';
import Typography from '../Typography/Typography.js';
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty.js';
import Tooltip from '../Tooltip/Tooltip.js';
import { truncateText, isTextTruncated } from '../../utils/truncateText/truncateText.js';

const OptionsDropdown = ({ onSelectVariable, dropdownPosition, filteredOptions = [], position = 'relative', width = '100%', zIndex, truncateTextValue = 34, }) => {
    return (jsx("div", { className: classNames(`ff-variable-dropdown-container ${position}`), style: dropdownPosition
            ? {
                top: dropdownPosition.top + 30,
                left: dropdownPosition.left - 30,
                width,
                zIndex,
            }
            : { width, zIndex }, children: !checkEmpty(filteredOptions) ? (filteredOptions?.map((option) => {
            return (jsx("div", { className: "ff-variable-option", onMouseDown: () => onSelectVariable(option), children: jsx(Tooltip, { title: isTextTruncated(option?.name, truncateTextValue, 'pixel')
                        ? option?.name
                        : '', children: jsx(Typography, { children: truncateText(option?.name, truncateTextValue, 'pixel') }) }) }, option?.id));
        })) : (jsx("div", { className: "ff-variable-option no-data", children: jsx(Typography, { as: "div", children: "No Option", fontSize: 14 }) })) }));
};

export { OptionsDropdown as default };
//# sourceMappingURL=OptionsDropdown.js.map
