2026-02-22 21:35:53 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import * as React from 'react';
|
2026-02-25 16:13:10 +01:00
|
|
|
import { cn } from '@/lib/utils';
|
2026-02-22 21:35:53 +01:00
|
|
|
|
|
|
|
|
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)}>
|
2026-03-01 07:46:21 +01:00
|
|
|
<textarea
|
2026-02-22 21:35:53 +01:00
|
|
|
value={value}
|
|
|
|
|
onChange={(e) => onChange(e.target.value)}
|
2026-03-01 07:46:21 +01:00
|
|
|
placeholder={placeholder || 'Type something…'}
|
|
|
|
|
rows={4}
|
2026-02-22 21:35:53 +01:00
|
|
|
maxLength={100}
|
2026-03-01 07:46:21 +01:00
|
|
|
className="w-full bg-transparent resize-none font-mono text-sm outline-none text-foreground placeholder:text-muted-foreground/35 border border-border/40 rounded-lg px-3 py-2.5 focus:border-primary/50 transition-colors"
|
|
|
|
|
spellCheck={false}
|
|
|
|
|
autoComplete="off"
|
2026-02-22 21:35:53 +01:00
|
|
|
/>
|
2026-03-01 07:46:21 +01:00
|
|
|
<div className="absolute bottom-3 right-3 text-[10px] text-muted-foreground/35 font-mono pointer-events-none tabular-nums">
|
2026-02-22 21:35:53 +01:00
|
|
|
{value.length}/100
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|