import React from 'react';

import { colorList, getImportsString, getPropsString } from '../helpers';

import Playground from '../Playground/Playground';
import { Radio } from '@/mui/components';

function RadioSection() {
  return (
    <Playground
      title="Radio"
      initialState={[
        {
          type: 'checkbox',
          stateId: 'checked',
          selected: false,
        },
        {
          type: 'select',
          stateId: 'color',
          options: colorList,
          selected: 'primary',
        },
        {
          type: 'checkbox',
          stateId: 'disableRipple',
          selected: false,
        },
        {
          type: 'checkbox',
          stateId: 'disabled',
          selected: false,
        },
        {
          type: 'select',
          stateId: 'size',
          options: ['xSmall', 'small', 'medium', 'large'],
          selected: 'medium',
        },
      ]}
      renderCallback={(state) => {
        const props = {
          ...state,
        };

        const importsList = getImportsString([[['Radio']]]);

        return {
          component: <Radio {...props} />,
          code: `${importsList}\n<Radio${getPropsString(props)}/>`,
        };
      }}
    />
  );
}

export default RadioSection;
