File size: 493 Bytes
cd6f98e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { motion } from "framer-motion";
import type { PropsWithChildren } from "react";

interface MotionProps extends PropsWithChildren {
  className?: string;
  delay?: number;
}

const FadeOut = (props: MotionProps) => (
  <motion.div
    exit={{ opacity: 0, x: -100 }}
    animate={{ scale: 1 }}
    transition={{ duration: 0.5, type: "spring", delay: props.delay ?? 0 }}
    {...props}
  >
    {props.children}
  </motion.div>
);

FadeOut.displayName = "FadeOut";
export default FadeOut;