24 lines
576 B
TypeScript
24 lines
576 B
TypeScript
import type { InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react";
|
|
|
|
type Props = {
|
|
label: string;
|
|
children: ReactNode;
|
|
};
|
|
|
|
export function FormRow({ label, children }: Props) {
|
|
return (
|
|
<label className="form-row">
|
|
<span>{label}</span>
|
|
{children}
|
|
</label>
|
|
);
|
|
}
|
|
|
|
export function TextInput(props: InputHTMLAttributes<HTMLInputElement>) {
|
|
return <input className="input" {...props} />;
|
|
}
|
|
|
|
export function TextArea(props: TextareaHTMLAttributes<HTMLTextAreaElement>) {
|
|
return <textarea className="input textarea" {...props} />;
|
|
}
|