Enlaces de ítems por wowhead (locale + tooltips) en toda la web

Sustituye la base de datos de ítems del sistema antiguo (AoWoW en
wotlk.novawow/wotlk.ultimowow) y los iconos de mirrors por wowhead / zamimg,
con el idioma del tooltip según el locale de la web (es. / www.).

Sistema reutilizable para rutas actuales y futuras:
- lib/wowhead.ts: wowheadUrl/wowheadItemUrl/wowheadWotlkHome (subdominio por
  locale), wowheadIcon (zamimg) y wowheadData (atributo data-wowhead, rama WotLK).
- components/WowheadLink.tsx: enlace con tooltip en el locale actual.
- layout raíz: config whTooltips (solo tooltips) + script tooltips.js global;
  funciona con contenido añadido por React (carrito, búsquedas).

Aplicado en: send-gift (catálogo + carrito), restore-items, recruit
(RecruitPanel, enlace por item_id + icono zamimg), quest-character (misión/npc/
facción + iconos), y el enlace "WOTLK DB" de la cabecera.

Verificado en prod (:3001): /es -> es.wowhead.com, /en -> www.wowhead.com,
data-wowhead presente, iconos por zamimg.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 22:34:26 +00:00
parent 809eb756c8
commit 7d1abab9f1
9 changed files with 132 additions and 23 deletions
+9 -4
View File
@@ -5,6 +5,7 @@ import { useTranslations, useLocale } from 'next-intl'
import type { GiftCategory, GiftItem } from '@/lib/gift'
import { CharacterSelect, type CharOption } from '@/components/CharacterSelect'
import { PaymentMethodSelect, type PayMethod } from '@/components/PaymentMethodSelect'
import { WowheadLink } from '@/components/WowheadLink'
// Tope de cantidad en la interfaz. El servidor lo revalida en priceCart (fuente de verdad).
const MAX_QTY = 100
@@ -186,9 +187,9 @@ export function SendGiftForm({
<div className="gift-grid">
{pageItems.map((it) => (
<div className="item-box" key={it.id}>
<a href={`https://www.wowhead.com/wotlk/item=${it.itemId}`} target="_blank" rel="noreferrer noopener">
<WowheadLink id={it.itemId}>
<img className="item-img-box" src={it.imageUrl} alt={it.name} />
</a>
</WowheadLink>
<div className="third-brown" style={{ fontSize: '12px' }}>{it.category}</div>
<div className="item-name second-brown">{it.name}</div>
<div className="yellow-info">
@@ -232,9 +233,13 @@ export function SendGiftForm({
{[...cart.values()].map((e) => (
<tr key={e.item.id}>
<td>
<img className="item-img-box" src={e.item.imageUrl} alt={e.item.name} />
<WowheadLink id={e.item.itemId}>
<img className="item-img-box" src={e.item.imageUrl} alt={e.item.name} />
</WowheadLink>
</td>
<td className="second-brown">
<WowheadLink id={e.item.itemId}>{e.item.name}</WowheadLink>
</td>
<td className="second-brown">{e.item.name}</td>
<td>
<input
type="number"