export const Input = ({
  type = "string",
  value,
  className,
  prefix,
  placeholder,
  onChange,
}: {
  type?: string;
  placeholder?: string;
  prefix?: string;
  className?: string;
  value?: string | number;
  onChange: (e: string | number) => void;
}) => {
  return type === "textarea" ? (
    <textarea
      className={`${className} outline-none w-full min-h-[120px] block`}
      placeholder={placeholder}
      value={value}
      onChange={({ target }) => onChange(target.value)}
    />
  ) : (
    <input
      type={type}
      className={`${className} outline-none  w-full`}
      placeholder={placeholder}
      value={value}
      onChange={({ target }) =>
        onChange(type === "number" ? Number(target.value) : target.value)
      }
    />
  );
};
