Spaces:
Configuration error
Configuration error
File size: 847 Bytes
78013c4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | "use client";
import React from "react";
interface GlassTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
label?: string;
error?: string;
}
export default function GlassTextarea({
label,
error,
id,
className = "",
...props
}: GlassTextareaProps): React.ReactElement {
const textareaId = id || label?.toLowerCase().replace(/\s+/g, "-");
return (
<div className="flex flex-col gap-1.5">
{label && (
<label htmlFor={textareaId} className="text-sm font-medium text-slate-300">
{label}
</label>
)}
<textarea
id={textareaId}
className={`glass-input min-h-[100px] resize-y ${error ? "glass-input-error" : ""} ${className}`}
{...props}
/>
{error && <p className="text-xs text-slate-300 mt-0.5">{error}</p>}
</div>
);
}
|