de473965 months ago20 lines · 616 B| 1 | "use client"; |
| 2 | |
| 3 | import { usePathname } from |
| 4 | import { motion, useReducedMotion |
| 5 | |
| 6 | export function PageTransition({ |
| 7 | const pathname = |
| 8 | const shouldReduceMotion = |
| 9 | return ( |
| 10 | <motion.div |
| 11 | key={pathname} |
| 12 | initial={shouldReduceMotion ? |
| 13 | animate={{ opacity: |
| 14 | transition={shouldReduceMotion ? |
| 15 | className="flex flex-col flex-1 overflow-hidden" |
| 16 | > |
| 17 | {children} |
| 18 | </motion.div> |
| 19 | ); |
| 20 | } |