Files
kit-ui/components/figlet/TextInput.tsx

30 lines
774 B
TypeScript

'use client';
import * as React from 'react';
import { cn } from '@/lib/utils';
import { Textarea } from '@/components/ui/textarea';
export interface TextInputProps {
value: string;
onChange: (value: string) => void;
placeholder?: string;
className?: string;
}
export function TextInput({ value, onChange, placeholder, className }: TextInputProps) {
return (
<div className={cn('relative', className)}>
<Textarea
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder || 'Type something...'}
className="h-32 resize-none"
maxLength={100}
/>
<div className="absolute bottom-2 right-2 text-xs text-muted-foreground">
{value.length}/100
</div>
</div>
);
}