mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-12-22 05:08:03 +00:00
96e99e2170
Port 51b83ed195
to glitch-soc
35 lines
644 B
TypeScript
35 lines
644 B
TypeScript
import React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
type Props = {
|
|
value: string;
|
|
checked: boolean;
|
|
name: string;
|
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
label: React.ReactNode;
|
|
};
|
|
|
|
export const RadioButton: React.FC<Props> = ({
|
|
name,
|
|
value,
|
|
checked,
|
|
onChange,
|
|
label,
|
|
}) => {
|
|
return (
|
|
<label className='radio-button'>
|
|
<input
|
|
name={name}
|
|
type='radio'
|
|
value={value}
|
|
checked={checked}
|
|
onChange={onChange}
|
|
/>
|
|
|
|
<span className={classNames('radio-button__input', { checked })} />
|
|
|
|
<span>{label}</span>
|
|
</label>
|
|
);
|
|
};
|