"use client"; import { motion, useInView } from "framer-motion"; import { useRef } from "react"; interface FadeInProps { children: React.ReactNode; delay?: number; direction?: "up" | "down" | "left" | "right" | "none"; className?: string; } export default function FadeIn({ children, delay = 0, direction = "up", className, }: FadeInProps) { const ref = useRef(null); const inView = useInView(ref, { once: true, margin: "-80px" }); const offsets = { up: { y: 28, x: 0 }, down: { y: -28, x: 0 }, left: { y: 0, x: 28 }, right: { y: 0, x: -28 }, none: { y: 0, x: 0 }, }; const { x, y } = offsets[direction]; return ( {children} ); }