openreplay/frontend/app/components/ui/Checkbox/Checkbox.tsx
2022-06-29 13:38:49 +02:00

20 lines
No EOL
472 B
TypeScript

import React from 'react';
import cn from 'classnames';
interface Props {
classNam?: string;
label?: string;
[x: string]: any;
}
export default (props: Props) => {
const { className = '', label = '', ...rest } = props;
return (
<label className={ cn("flex items-center cursor-pointer", className)}>
<input
type="checkbox"
{ ...rest }
/>
{label && <span className="ml-2 select-none mb-0">{label}</span>}
</label>
)
};