import { cn } from "@/lib/utils";

type InputSize = "default" | "compact";

type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
  inputSize?: InputSize;
};

const sizeMap: Record<InputSize, string> = {
  default: "min-h-11 px-3 py-2 text-sm",
  compact: "min-h-8 px-2.5 py-1.5 text-xs",
};

export function Input({
  className,
  inputSize = "default",
  ...props
}: InputProps) {
  return (
    <input
      className={cn(
        "w-full rounded-lg border border-[color:var(--line-weak)] bg-[color:var(--panel-soft)] text-[color:var(--terminal-bright)] outline-none transition placeholder:text-[color:var(--terminal-muted)] focus:border-[color:var(--line-strong)]",
        sizeMap[inputSize],
        className,
      )}
      {...props}
    />
  );
}
