feat: Implement a new CountUp component and refactor calendar day details to use a Sheet instead of a Dialog.

This commit is contained in:
2025-12-14 02:16:29 -05:00
parent 91d410cbce
commit ed0dacb435
4 changed files with 137 additions and 116 deletions
+15
View File
@@ -0,0 +1,15 @@
"use client";
import { motion, useSpring, useTransform } from "framer-motion";
import { useEffect } from "react";
export function CountUp({ value, prefix = "", suffix = "" }: { value: number, prefix?: string, suffix?: string }) {
const spring = useSpring(value, { mass: 0.8, stiffness: 75, damping: 15 });
const display = useTransform(spring, (current) => `${prefix}${current.toFixed(2)}${suffix}`);
useEffect(() => {
spring.set(value);
}, [spring, value]);
return <motion.span>{display}</motion.span>;
}