import { __ } from '@wordpress/i18n';
import { SelectControl } from '@wordpress/components';
import { getResponsiveSelectOptions } from '../../controls/responsiveValueUtils';

export default function DisplayHover({ activeDevice, display__hover, updateDeviceAttribute }) {
  const handleDisplayChange = (value) => {
    updateDeviceAttribute('display__hover', value);
  };
  const displayOptions = getResponsiveSelectOptions({
    values: display__hover,
    activeDevice,
    inheritedLabel: __('Inherited', 'axcelersblocks'),
    options: [
      { value: '', label: __('Default', 'axcelersblocks') },
      { value: 'block', label: __('Block', 'axcelersblocks') },
      { value: 'flex', label: __('Flex', 'axcelersblocks') },
      { value: 'grid', label: __('Grid', 'axcelersblocks') },
      { value: 'inline', label: __('Inline', 'axcelersblocks') },
      { value: 'inline-block', label: __('Inline Block', 'axcelersblocks') },
      { value: 'inline-flex', label: __('Inline Flex', 'axcelersblocks') },
      { value: 'inline-grid', label: __('Inline Grid', 'axcelersblocks') },
      { value: 'list-item', label: __('List Item', 'axcelersblocks') },
      { value: 'none', label: __('None', 'axcelersblocks') },
    ],
  });

  return (
    <SelectControl
      className='display-hover-control'
      label={__('Display (Hover)', 'axcelersblocks')}
      value={display__hover[activeDevice] || ''}
      options={displayOptions}
      onChange={handleDisplayChange}
    />
  );
}
