- "content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst svgVariants: Variants = {\n normal: {\n y: 0,\n },\n animate: {\n y: [0, -5, -3],\n transition: {\n duration: 0.5,\n times: [0, 0.6, 1],\n type: 'spring',\n stiffness: 200,\n damping: 10,\n },\n },\n};\n\nconst checkVariants: Variants = {\n normal: {\n opacity: 1,\n },\n animate: {\n opacity: [0, 1],\n pathLength: [0, 1],\n transition: {\n delay: 0.3,\n duration: 0.3,\n opacity: { duration: 0.1, delay: 0.3 },\n },\n },\n};\n\nconst MapPinCheckIcon = () => {\n const controls = useAnimation();\n\n return (\n <div\n className=\"cursor-pointer select-none p-2 hover:bg-accent rounded-md transition-colors duration-200 flex items-center justify-center\"\n onMouseEnter={() => controls.start('animate')}\n onMouseLeave={() => controls.start('normal')}\n >\n <motion.svg \n xmlns=\"http://www.w3.org/2000/svg\" \n width=\"28\" \n height=\"28\" \n viewBox=\"0 0 24 24\" \n fill=\"none\" \n stroke=\"currentColor\" \n strokeWidth=\"2\" \n strokeLinecap=\"round\" \n strokeLinejoin=\"round\"\n variants={svgVariants}\n initial=\"normal\"\n animate={controls}\n >\n <path d=\"M19.43 12.935c.357-.967.57-1.955.57-2.935a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 1.202 0 32.197 32.197 0 0 0 .813-.728\"/>\n <circle cx=\"12\" cy=\"10\" r=\"3\"/>\n <motion.path \n d=\"m16 18 2 2 4-4\"\n variants={checkVariants}\n initial=\"normal\"\n animate={controls}\n />\n </motion.svg>\n </div>\n );\n};\n\nexport { MapPinCheckIcon };\n",
0 commit comments