import React from 'react';
import { motion } from 'framer-motion';

export const AnimatedForm = ({ children, onSubmit }: { children: React.ReactNode; onSubmit?: () => void }) => {
  return (
    <motion.form
      onSubmit={e => {
        e.preventDefault();
        onSubmit?.();
      }}
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
      className="space-y-4 p-4 bg-white shadow-md rounded-xl"
    >
      {children}
    </motion.form>
  );
};
