"use client";

import { motion } from "framer-motion";
import type { ReactNode } from "react";

export function MotionTitle({
  children,
  delay,
  mounted,
}: {
  children: ReactNode;
  delay: number;
  mounted: boolean;
}) {
  return (
    <motion.div
      initial={mounted ? { opacity: 0, y: 16 } : false}
      animate={mounted ? { opacity: 1, y: 0 } : {}}
      transition={{
        delay,
        type: "spring",
        stiffness: 260,
        damping: 26,
        mass: 0.9,
      }}
      className="flex items-center justify-between gap-2"
    >
      {children}
    </motion.div>
  );
}
