初始化项目;更新至 v0.1.0_20251209 版本
This commit is contained in:
25
components/TextArea.tsx
Normal file
25
components/TextArea.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
|
||||
interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
||||
label: string;
|
||||
helperText?: string;
|
||||
}
|
||||
|
||||
export const TextArea: React.FC<TextAreaProps> = ({ label, helperText, className = '', ...props }) => {
|
||||
return (
|
||||
<div className="flex flex-col gap-1.5 h-full">
|
||||
<div className="flex justify-between items-baseline">
|
||||
<label className="block text-sm font-semibold text-gray-700">
|
||||
{label}
|
||||
</label>
|
||||
{helperText && (
|
||||
<span className="text-xs text-gray-500 italic">{helperText}</span>
|
||||
)}
|
||||
</div>
|
||||
<textarea
|
||||
className={`flex-1 w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm p-3 border resize-none font-mono bg-white text-gray-800 ${className}`}
|
||||
{...props}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user