import { AnimatePresence, motion } from "framer-motion"; import { Icon, type IconName } from "@calcom/ui/components/icon"; // Ring sizes - just the diameters, all centered on the icon const RING_SIZES = [166, 233, 345, 465]; // Positions for small user icons on rings (for team variant) // Format: [ringIndex, angleInDegrees] // Angles: 0 = top, 90 = right, 180 = bottom, 270 = left const TEAM_ICON_POSITIONS = [ { ringIndex: 2, angle: 30 }, // Top-right of third ring { ringIndex: 2, angle: 150 }, // Bottom-left of third ring { ringIndex: 2, angle: 210 }, // Bottom-left of third ring { ringIndex: 2, angle: 330 }, // Top-left of third ring { ringIndex: 3, angle: 0 }, // Top of largest ring { ringIndex: 3, angle: 180 }, // Bottom of largest ring ]; export function PlanIcon({ icon, variant = "single", animationDirection = "down", }: { icon: IconName; variant?: "single" | "organization" | "team"; animationDirection?: "up" | "down"; }) { const renderIconContainer = () => { return (
{/* Icon */}
{/* Inner highlight/shine effect */}
); }; const renderSmallUserIcon = (ringIndex: number, angle: number, index: number) => { const ringSize = RING_SIZES[ringIndex]; const radius = ringSize / 2; const angleRad = (angle * Math.PI) / 180; // Calculate position on the ring const x = Math.cos(angleRad) * radius; const y = Math.sin(angleRad) * radius; const iconHalfSize = 20.25; // Half of 40.5px return (
); }; return (
{/* Generate concentric rings centered on icon */} {RING_SIZES.map((size, index) => { const opacity = [0.6, 0.5, 0.4, 0.35][index] || 0.3; return (
); })} {/* Small user icons on rings (for team variant) */} {variant === "team" || variant === "organization" ? TEAM_ICON_POSITIONS.map(({ ringIndex, angle }, index) => renderSmallUserIcon(ringIndex, angle, index) ) : null} {renderIconContainer()}
); }