'use client' import { useState } from 'react' import { useTranslations } from 'next-intl' import { Link } from '@/i18n/navigation' type Tool = { href: string; icon: string; label: string; desc: string } /** Replica los paneles plegables «OPCIONES DE CUENTA / OPCIONES DE PERSONAJE» * del my-account de Django (acordeón por click), con las herramientas ya * implementadas en Next. */ export function AccountTools({ isAdmin }: { isAdmin: boolean }) { const t = useTranslations('Account') const accountTools: Tool[] = [ { href: '/change-password', icon: 'password-icon', label: t('svcChangePassword'), desc: t('svcChangePasswordDesc') }, { href: '/change-email', icon: 'email-icon', label: t('svcChangeEmail'), desc: t('svcChangeEmailDesc') }, { href: '/security-token', icon: 'token-icon', label: t('svcToken'), desc: t('svcTokenDesc') }, { href: '/recruit', icon: 'recruit-a-friend-icon', label: t('svcRecruit'), desc: t('svcRecruitDesc') }, { href: '/vote-points', icon: 'vote-icon', label: t('svcVote'), desc: t('svcVoteDesc') }, // Panel de administración: una tool-button más dentro de «Opciones de cuenta» (solo admins). ...(isAdmin ? [{ href: '/admin', icon: 'store-icon', label: `🛡️ ${t('adminPanel')}`, desc: t('adminPanelDesc') }] : []), ] const characterTools: Tool[] = [ { href: '/unstuck', icon: 'unstuck-icon', label: t('svcUnstuck'), desc: t('svcUnstuckDesc') }, { href: '/revive', icon: 'revive-icon', label: t('svcRevive'), desc: t('svcReviveDesc') }, { href: '/rename', icon: 'rename-icon', label: t('svcRename'), desc: t('svcRenameDesc') }, { href: '/customize', icon: 'customize-icon', label: t('svcCustomize'), desc: t('svcCustomizeDesc') }, { href: '/change-race', icon: 'change-race-icon', label: t('svcChangeRace'), desc: t('svcChangeRaceDesc') }, { href: '/change-faction', icon: 'change-faction-icon', label: t('svcChangeFaction'), desc: t('svcChangeFactionDesc') }, { href: '/level-up', icon: 'level-up-icon', label: t('svcLevelUp'), desc: t('svcLevelUpDesc') }, { href: '/gold', icon: 'gold-icon', label: t('svcGold'), desc: t('svcGoldDesc') }, { href: '/transfer', icon: 'tranfer-char-icon', label: t('svcTransfer'), desc: t('svcTransferDesc') }, { href: '/battlepay', icon: 'store-icon', label: t('svcStore'), desc: t('svcStoreDesc') }, ] const historyTools: Tool[] = [ { href: '/points-history', icon: 'pointsh-icon', label: t('svcPointsHistory'), desc: t('svcPointsHistoryDesc') }, { href: '/trans-history', icon: 'dnth-icon', label: t('svcTransHistory'), desc: t('svcTransHistoryDesc') }, { href: '/ban-history', icon: 'banh-icon', label: t('svcBanHistory'), desc: t('svcBanHistoryDesc') }, { href: '/security-history', icon: 'securityh-icon', label: t('svcSecurityHistory'), desc: t('svcSecurityHistoryDesc') }, ] return (
|
{it.label}
{it.desc} |
))}
{pair.length === 1 && } |