import { RadioGroup } from '@headlessui/react' import { useState } from 'react' import { classNames } from '../../utils/class-names' export default function Home() { let access = [ { id: 'access-1', name: 'Public access', description: 'This project would be available to anyone who has the link', }, { id: 'access-2', name: 'Private to Project Members', description: 'Only members of this project would be able to access', }, { id: 'access-3', name: 'Private to you', description: 'You are the only one able to access this project', }, ] let [active, setActive] = useState() return (
Link before

Privacy setting

{access.map(({ id, name, description }, i) => { return ( classNames( // Rounded corners i === 0 && 'rounded-tl-md rounded-tr-md', access.length - 1 === i && 'rounded-bl-md rounded-br-md', // Shared 'relative flex border p-4 focus:outline-none', active ? 'z-10 border-indigo-200 bg-indigo-50' : 'border-gray-200' ) } > {({ active, checked }) => (
{name} {description}
{checked && ( )}
)}
) })}
Link after
) }