mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-14 05:05:09 +03:00
51de056e5f
Issue: https://github.com/users/StanGirard/projects/5/views/2?pane=issue&itemId=46291978 - Finalise steps based brain creation - Remove feature flag - Demo: <img width="1068" alt="Screenshot 2023-12-05 at 18 05 52" src="https://github.com/StanGirard/quivr/assets/63923024/99e38cab-d510-4bb5-8153-b0db406d1650"> https://github.com/StanGirard/quivr/assets/63923024/1850e2bd-5df1-43fe-be9e-261a3b90af2b https://github.com/StanGirard/quivr/assets/63923024/c7335679-b090-40ac-aece-fbaae0303d51
45 lines
1.0 KiB
TypeScript
45 lines
1.0 KiB
TypeScript
import {
|
|
DetailedHTMLProps,
|
|
forwardRef,
|
|
InputHTMLAttributes,
|
|
RefObject,
|
|
} from "react";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
interface FieldProps
|
|
extends DetailedHTMLProps<
|
|
InputHTMLAttributes<HTMLTextAreaElement>,
|
|
HTMLTextAreaElement
|
|
> {
|
|
label?: string;
|
|
name: string;
|
|
}
|
|
|
|
export const TextArea = forwardRef(
|
|
(
|
|
{ label, className, name, required = false, ...props }: FieldProps,
|
|
forwardedRef
|
|
) => {
|
|
return (
|
|
<fieldset className={cn("flex flex-col w-full", className)} name={name}>
|
|
{label !== undefined && (
|
|
<label htmlFor={name} className="text-sm">
|
|
{label}
|
|
{required && <span>*</span>}
|
|
</label>
|
|
)}
|
|
<textarea
|
|
ref={forwardedRef as RefObject<HTMLTextAreaElement>}
|
|
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>
|
|
);
|
|
}
|
|
);
|
|
|
|
TextArea.displayName = "TextArea";
|