diff --git a/components/RadioButton.tsx b/components/RadioButton.tsx new file mode 100644 index 0000000..2e275e0 --- /dev/null +++ b/components/RadioButton.tsx @@ -0,0 +1,36 @@ +'use client' + +// https://tailwindui.com/components/application-ui/forms/radio-groups + +import { useState } from 'react' + +export default function RadioButtonGroup({ options }: { options: {id: string}[] }) { + + const [selectedOption, setSelectedOption] = useState(options[0].id) + + function onValueChange(event: any){ + setSelectedOption(event.target.value) + } + + return ( +
+ {options.map((option) => ( +
+ + + +
+ ))} +
+ ) +} + +// export default RadioButtonGroup \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 590f435..d81d4ee 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,8 @@ "@/*": [ "./*" ] - } + }, + "target": "ES2017" }, "include": [ "next-env.d.ts",