Files
remark42/frontend/app/components/input/input.tsx
T
2022-07-01 12:22:57 -05:00

15 lines
387 B
TypeScript

import { h, JSX } from 'preact';
import clsx from 'clsx';
import styles from './input.module.css';
type Props = JSX.HTMLAttributes<HTMLInputElement> & {
invalid?: boolean;
};
export function Input({ className, type, invalid, ...props }: Props) {
return (
<input className={clsx(className, styles.input, { [styles.invalid]: invalid })} type={type ?? 'text'} {...props}/>
);
}