"use client";

import { motion } from "framer-motion";

export default function HomeAnimations({ children, type, className, style }: { children: React.ReactNode, type: string, className?: string, style?: React.CSSProperties }) {
    if (type === "hero-text") {
        return (
            <motion.div initial={{ opacity: 0, y: 30 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.8 }} className={className} style={style}>
                {children}
            </motion.div>
        );
    }

    if (type === "hero-image") {
        return (
            <motion.div initial={{ opacity: 0, scale: 0.9, rotate: -2 }} animate={{ opacity: 1, scale: 1, rotate: 0 }} transition={{ duration: 1, delay: 0.2, type: "spring" }} className={className} style={style}>
                {children}
            </motion.div>
        );
    }

    return <motion.div className={className} style={style}>{children}</motion.div>;
}
