'use strict';

var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
var React = require('react');
var index = require('../../node_modules/.pnpm/@radix-ui_react-select@2.1.1_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs');
var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
var select_module = require('./select.module.css.cjs');
var text = require('../text/text.cjs');
var selectRoot = require('./select-root.cjs');

const SelectItem = React.forwardRef(({ className, textProps = {}, children, value, leadingIcon, ...props }, ref) => {
    const { registerIcon, unregisterIcon } = selectRoot.useSelectContext();
    React.useEffect(() => {
        if (!leadingIcon)
            return;
        registerIcon(value, leadingIcon);
        return () => {
            unregisterIcon(value);
        };
    }, [value, leadingIcon]);
    return (jsxRuntime.jsxRuntimeExports.jsxs(index.Item, { ref: ref, value: value, className: index$1.cx(select_module.default.menuitem, className), ...props, children: [leadingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: select_module.default.itemIcon, children: leadingIcon }), jsxRuntime.jsxRuntimeExports.jsx(index.ItemText, { children: jsxRuntime.jsxRuntimeExports.jsx(text.Text, { ...textProps, children: children }) })] }));
});
SelectItem.displayName = index.Item.displayName;

exports.SelectItem = SelectItem;
//# sourceMappingURL=select-item.cjs.map
