'use client';
import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { components as SelectComponents } from 'react-select';
import { useTranslation } from '../../../providers/Translation/index.js';
import './index.scss';
const baseClass = 'value-container';
export const ValueContainer = (props)=>{
    // @ts-expect-error-next-line // TODO Fix this - moduleResolution 16 breaks our declare module
    const { selectProps: { customProps, value } = {} } = props;
    const { i18n } = useTranslation();
    // Get the title for single-value selects
    let titleText = '';
    if (value && !Array.isArray(value) && typeof value === 'object' && 'label' in value) {
        const labelText = value.label ? getTranslation(value.label, i18n) : '';
        titleText = typeof labelText === 'string' ? labelText : '';
    }
    return /*#__PURE__*/ _jsxDEV("div", {
        className: baseClass,
        ref: customProps?.droppableRef,
        title: titleText,
        children: [
            customProps?.valueContainerLabel && /*#__PURE__*/ _jsxDEV("span", {
                className: `${baseClass}__label`,
                children: customProps?.valueContainerLabel
            }, void 0, false, {
                fileName: "src/elements/ReactSelect/ValueContainer/index.tsx",
                lineNumber: 31,
                columnNumber: 9
            }, this),
            /*#__PURE__*/ _jsxDEV(SelectComponents.ValueContainer, {
                ...props
            }, void 0, false, {
                fileName: "src/elements/ReactSelect/ValueContainer/index.tsx",
                lineNumber: 33,
                columnNumber: 7
            }, this)
        ]
    }, void 0, true, {
        fileName: "src/elements/ReactSelect/ValueContainer/index.tsx",
        lineNumber: 29,
        columnNumber: 5
    }, this);
};

//# sourceMappingURL=index.js.map