import { motion, type HTMLMotionProps } from "motion/react";
import clsx, { type ClassValue } from "clsx";

import classes from "./TextInput.module.css";

type Props = Omit<HTMLMotionProps<"input">, "className"> & {
  className?: ClassValue;
  error?: boolean;
};

export default function TextInput({ className, error, ...props }: Props) {
  return (
    <motion.input
      {...props}
      type="text"
      className={clsx(classes.input, error && classes.error, className)}
    />
  );
}
