import { Icon } from '@iconify-icon/react'; import { useRef, type MouseEvent } from 'react'; interface Item { name: string; icon: string; level: 'primary' | 'secondary'; } interface Props { label: string; items: Item[]; accent?: 'cyan' | 'magenta'; } export default function SkillCard({ label, items, accent = 'cyan' }: Props) { const ref = useRef(null); function onMove(e: MouseEvent) { if (!ref.current) return; const rect = ref.current.getBoundingClientRect(); const x = (e.clientX - rect.left) / rect.width - 0.5; const y = (e.clientY - rect.top) / rect.height - 0.5; ref.current.style.transform = `perspective(1000px) rotateX(${-y * 6}deg) rotateY(${x * 6}deg) translateZ(0)`; } function onLeave() { if (!ref.current) return; ref.current.style.transform = 'perspective(1000px) rotateX(0) rotateY(0)'; } const accentColor = accent === 'cyan' ? 'var(--color-cyan)' : 'var(--color-magenta)'; return (

{label}

{items.map((item) => (
{item.name}
))}
); }