"use client";

import { motion } from "framer-motion";
import { PropsWithChildren } from "react";

export function ScrollReveal({
  children,
  delay = 0,
  y = 24,
}: PropsWithChildren<{ delay?: number; y?: number }>) {
  return (
    <motion.div
      className="w-full min-w-0 max-w-full"
      initial={{ opacity: 0, y }}
      whileInView={{ opacity: 1, y: 0 }}
      viewport={{ once: true, amount: 0.2 }}
      transition={{ duration: 0.55, ease: "easeOut", delay }}
    >
      {children}
    </motion.div>
  );
}
