2026-02-28 00:58:57 +01:00
|
|
|
'use client';
|
|
|
|
|
|
2026-03-01 08:37:39 +01:00
|
|
|
const MAX_LENGTH = 2048;
|
2026-02-28 00:58:57 +01:00
|
|
|
|
|
|
|
|
interface QRInputProps {
|
|
|
|
|
value: string;
|
|
|
|
|
onChange: (value: string) => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function QRInput({ value, onChange }: QRInputProps) {
|
|
|
|
|
return (
|
2026-03-01 08:37:39 +01:00
|
|
|
<div>
|
|
|
|
|
<span className="text-[10px] font-semibold text-muted-foreground uppercase tracking-widest block mb-2">
|
|
|
|
|
Content
|
|
|
|
|
</span>
|
|
|
|
|
<textarea
|
|
|
|
|
value={value}
|
|
|
|
|
onChange={(e) => onChange(e.target.value)}
|
|
|
|
|
placeholder="Enter text or URL…"
|
|
|
|
|
maxLength={MAX_LENGTH}
|
|
|
|
|
rows={4}
|
|
|
|
|
className="w-full bg-transparent border border-border/40 rounded-lg px-3 py-2.5 text-xs font-mono outline-none focus:border-primary/50 transition-colors text-foreground/80 placeholder:text-muted-foreground/30 resize-none"
|
|
|
|
|
/>
|
|
|
|
|
<div className="text-[9px] text-muted-foreground/30 font-mono text-right mt-1 tabular-nums">
|
|
|
|
|
{value.length} / {MAX_LENGTH}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-28 00:58:57 +01:00
|
|
|
);
|
|
|
|
|
}
|