import { motion } from "framer-motion";
import { CSSProperties, ReactNode } from "react";

export default function PageTransition({
  className,
  children,
  style = {},
}: {
  className?: string;
  children: ReactNode;
  style?: CSSProperties;
}) {
  return (
    <motion.div
      className={className}
      initial={{ opacity: 0, scale: 0.95 }}
      animate={{ opacity: 1, scale: 1 }}
      transition={{
        type: "spring",
        stiffness: 260,
        damping: 20,
      }}
      style={style}
    >
      {children}
    </motion.div>
  );
}
