import React from 'react';
import { validate as isUuid } from 'uuid';
import { Wrapper, ButtonWrapper } from './radioButtons1.styles';

const RadioButtons1 = ({
  options,
  value,
  onChange,
  disabled,
  cssClass
}) => {
  if (!options || options.length === 0) return null;
  return /*#__PURE__*/React.createElement(Wrapper, {
    className: "inputs-container"
  }, options.map(({
    selected,
    label,
    value: val
  }, i) => /*#__PURE__*/React.createElement(ButtonWrapper, {
    key: i,
    onClick: () => onChange(val),
    selected: (!value || value === '') && i === 0 ? true : isUuid(val) ? val === value && value.assetId : val === value,
    disabled: !!disabled,
    id: `${label.split(' ').join('-').toLowerCase()}`
  }, label)));
};

export default RadioButtons1;