import React, { useState } from 'react';
import { RadioGroup } from '.';
import { Radio } from './Radio';

export default {
  title: 'Radio Group',
  component: RadioGroup,
};

export const Default = () => {
  const [value, setValue] = useState('opt1');

  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
    setValue(e.target.value);
  };
  return (
    <RadioGroup onChange={handleChange} value={value}>
      <Radio value="opt1" label="Option 1" />
      <Radio value="opt2" label="Option 2" />
    </RadioGroup>
  );
};
