"use client"; import useRelicMakerStore from "@/stores/relicMakerStore"; import useUserDataStore from "@/stores/userDataStore"; import Image from "next/image"; import { useMemo } from "react"; interface RelicCardProps { slot: string avatarId: string } const getRarityColor = (rarity: string) => { switch (rarity) { case '3': return 'border-green-500 shadow-green-500/50 bg-linear-to-br from-green-700 via-green-400 to-green-500'; case '4': return 'border-blue-500 shadow-blue-500/50 bg-linear-to-br from-blue-700 via-blue-400 to-blue-500'; case '5': return 'border-purple-500 shadow-purple-500/50 bg-linear-to-br from-purple-700 via-purple-400 to-purple-500'; case '6': return 'border-yellow-500 shadow-yellow-500/50 bg-linear-to-br from-yellow-700 via-yellow-400 to-yellow-500'; default: return 'border-gray-500 shadow-gray-500/50'; } }; const getRarityName = (slot: string) => { switch (slot) { case '1': return (
Head

Head

); case '2': return (
Hand

Hands

); case '3': return (
Body

Body

); case '4': return (
Foot

Feet

); case '5': return (
Neck

Planar sphere

); case '6': return (
Object

Link rope

); default: return ''; } }; export default function RelicCard({ slot, avatarId }: RelicCardProps) { const { avatars } = useUserDataStore() const { selectedRelicSlot } = useRelicMakerStore() const relicDetail = useMemo(() => { const avatar = avatars[avatarId]; if (avatar) { if (avatar.profileList[avatar.profileSelect].relics[slot]) { return avatar.profileList[avatar.profileSelect].relics[slot]; } return null; } return null; }, [avatars, avatarId, slot]); return (
{relicDetail ? (
Relic {/* Level Badge */}
+{relicDetail.level}
{getRarityName(slot)}
) : (
{/* Level Badge */}
+{0}
{getRarityName(slot)}
)}
) }