import React, { forwardRef } from 'react';
import DropdownSelectboxTrigger from './dropdown-selectbox-trigger';
import DropdownMenuTrigger from './dropdown-menu-trigger';
import { useTranslation } from '../hooks/use-translation';
import { jsx as _jsx } from "react/jsx-runtime";
const DropdownTrigger = /*#__PURE__*/forwardRef(({
  onClick,
  isOpen,
  isDisabled,
  hasSuccess,
  hasWarnings,
  hasErrored,
  options,
  selectedItem,
  selectbox,
  triggerOptions,
  isSectioned = false,
  isOptional = false,
  optionalLabelText
}, ref) => {
  const {
    t
  } = useTranslation();
  return selectbox ? /*#__PURE__*/_jsx(DropdownSelectboxTrigger, {
    ref: ref,
    onClick: onClick,
    isOpen: isOpen,
    options: options,
    isDisabled: isDisabled,
    hasErrored: hasErrored,
    hasSuccess: hasSuccess,
    hasWarnings: hasWarnings,
    selectedItem: selectedItem,
    triggerOptions: triggerOptions,
    selectbox: selectbox,
    isSectioned: isSectioned,
    isOptional: isOptional,
    optionalLabelText: optionalLabelText ?? t('Optional')
  }) : /*#__PURE__*/_jsx(DropdownMenuTrigger, {
    ref: ref,
    onClick: onClick,
    isOpen: isOpen,
    isDisabled: isDisabled,
    hasErrored: hasErrored,
    hasSuccess: hasSuccess,
    hasWarnings: hasWarnings,
    selectedItem: selectedItem,
    triggerOptions: triggerOptions
  });
});
DropdownTrigger.displayName = 'DropdownTrigger';
export default DropdownTrigger;