import type { ChangeEvent, ReactNode } from "react"; /** 后台文本框:与聊天搜索同款壳层,聚焦只画外框一圈 */ export default function AdminField({ id, label, hint, value, onChange, placeholder, maxLength, as = "input", type = "text", autoComplete, disabled, className = "", minHeight, }: { id: string; label: ReactNode; hint?: ReactNode; value: string; onChange: (v: string) => void; placeholder?: string; maxLength?: number; as?: "input" | "textarea"; type?: string; autoComplete?: string; disabled?: boolean; className?: string; minHeight?: string; }) { const handle = (e: ChangeEvent) => onChange(e.target.value); return (
{maxLength != null && ( {value.length}/{maxLength} )}
{hint != null && hint !== "" && (

{hint}

)} {as === "textarea" ? (