15 lines
482 B
TypeScript
15 lines
482 B
TypeScript
import type { JSX } from "preact";
|
|
|
|
import { twMerge } from "@/src/tw.ts";
|
|
|
|
export const FIELD_CLASS =
|
|
"w-full rounded-lg border border-gray-300 px-2 py-1 leading-loose dark:border-gray-700 dark:bg-gray-800";
|
|
|
|
interface InputFieldProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "class"> {
|
|
class?: string;
|
|
}
|
|
|
|
export default function InputField({ class: extra, ...props }: InputFieldProps) {
|
|
return <input class={twMerge(FIELD_CLASS, "h-12", extra)} {...props} />;
|
|
}
|