mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-27 19:41:37 +01:00
87a704f70b
Port 76264e3fe8
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
30 lines
662 B
TypeScript
30 lines
662 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>
|
|
);
|
|
};
|
|
|
|
export default RadioButton;
|