mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 11:21:35 +03:00
1d7bc8a5bc
* remove duplicate import * 🚧 add new linter configuration * 🧑💻 add and run prettier * 🐛 add babel parser for linter * 🧑💻 add lint-fix command * 🚨 use lint-fix * 🚨 remove 'FC' as a type. Use const and JSX.Element * 🚨 enforce arrow function rule from linter * 🔥 delete unused file * 🚨 adding /* eslint-disable */ in failing files * 💩 add ts-expect-error to Victory components
43 lines
978 B
TypeScript
43 lines
978 B
TypeScript
/* eslint-disable */
|
|
import {
|
|
DetailedHTMLProps,
|
|
forwardRef,
|
|
InputHTMLAttributes,
|
|
RefObject,
|
|
} from "react";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface FieldProps
|
|
extends DetailedHTMLProps<
|
|
InputHTMLAttributes<HTMLInputElement>,
|
|
HTMLInputElement
|
|
> {
|
|
label?: string;
|
|
name: string;
|
|
}
|
|
|
|
const Field = forwardRef(
|
|
({ label, className, name, ...props }: FieldProps, forwardedRef) => {
|
|
return (
|
|
<fieldset className={cn("flex flex-col w-full", className)} name={name}>
|
|
{label && (
|
|
<label htmlFor={name} className="text-sm">
|
|
{label}
|
|
</label>
|
|
)}
|
|
<input
|
|
ref={forwardedRef as RefObject<HTMLInputElement>}
|
|
className="w-full bg-gray-50 dark:bg-gray-900 px-4 py-2 border rounded-md border-black/10 dark:border-white/25"
|
|
name={name}
|
|
id={name}
|
|
{...props}
|
|
/>
|
|
</fieldset>
|
|
);
|
|
}
|
|
);
|
|
Field.displayName = "Field";
|
|
|
|
export default Field;
|