"use client"

import { motion, type MotionProps } from "framer-motion"
import type { ReactNode } from "react"

interface AnimatedWrapperProps extends MotionProps {
  children: ReactNode
  className?: string
  delay?: number
}

export function AnimatedWrapper({ children, className, delay = 0, ...props }: AnimatedWrapperProps) {
  return (
    <motion.div
      initial={{ opacity: 0, y: 50 }}
      whileInView={{ opacity: 1, y: 0 }}
      viewport={{ once: true, amount: 0.2 }}
      transition={{ duration: 0.6, ease: [0.25, 0.1, 0.25, 1], delay }}
      className={className}
      {...props}
    >
      {children}
    </motion.div>
  )
}
