"use client"
import { animate, motion } from "framer-motion"
import React, { useEffect } from "react"
import { cn } from "@/lib/utils"
export interface CardProps {
className?: string
children?: React.ReactNode
withSparkles?: boolean
withIcons?: Array<{
icon: React.ReactNode
size?: "sm" | "md" | "lg"
className?: string
}>
}
const sizeMap = {
sm: "h-8 w-8",
md: "h-12 w-12",
lg: "h-16 w-16",
}
export function Card({ className, children, withSparkles = false, withIcons = [] }: CardProps) {
return (
{(withSparkles || withIcons.length > 0) && (
{withIcons.length > 0 &&
}
{withSparkles &&
}
)}
{children}
)
}
// 保持原有的 AnimatedCard 组件以向后兼容
export function AnimatedCard({ className, title, description, icons = [] }: {
className?: string
title?: React.ReactNode
description?: React.ReactNode
icons?: Array<{
icon: React.ReactNode
size?: "sm" | "md" | "lg"
className?: string
}>
}) {
return (
{title && (
{title}
)}
{description && (
{description}
)}
)
}
const AnimatedIcons = ({ icons }: {
icons: Array<{
icon: React.ReactNode
size?: "sm" | "md" | "lg"
className?: string
}>
}) => {
return (
{icons.map((iconData, index) => (
{iconData.icon}
))}
)
}
const Container = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes
>(({ className, ...props }, ref) => (
))
Container.displayName = "Container"
const AnimatedSparkles = () => (
)
const Sparkles = () => {
const randomMove = () => Math.random() * 2 - 1
const randomOpacity = () => Math.random()
const random = () => Math.random()
return (
{[...Array(12)].map((_, i) => (
))}
)
}