sokko-g/website/src/features/cards/Currency.jsx
Shinuwa 88c7bf8317 Group Sokko TCG's interface files by Guild quest and card rendering
The 48 files of the Daily Card, Expeditions, Daily Team and race, Broken
Mirror and card rendering move to daily/, expeditions/, team/, mirror/ and
rendering/ under website/src/features/cards, with every relative import
rewritten. The root keeps the page, server calls, cache and the player
sections outside the Guild. The cards README, the quest recipe and the
current docs follow the new paths; dated audits and plans keep theirs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:35:18 +01:00

29 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @file Affiche les deux monnaies de Sokko TCG, la poussière d'étoiles et les Éclats d'étoile, avec leur
* icône.
*
* Les icônes sont des images (static/icons) : leurs dégradés SVG ne peuvent pas entrer en conflit avec la
* page.
*/
import { formatEclats } from "./expeditions/expeditionFormat.js";
import { formatStardust } from "./stardustFormat.js";
const ICONS = { stardust: "/static/icons/stardust.svg", eclats: "/static/icons/eclat.svg" };
export function CurrencyIcon({ kind }) {
return <img className="nebula-currency-icon" data-currency={kind} src={ICONS[kind]} alt="" aria-hidden="true" />;
}
// Icône suivie d'un texte libre (« 70 Éclats ») dans un bouton ou un badge : un seul bloc en ligne, aligné sur le texte.
export function CurrencyAmount({ kind, children }) {
return <span className="nebula-currency-amount"><CurrencyIcon kind={kind} />{children}</span>;
}
export function StardustBalance({ value }) {
return <span className="nebula-stardust" aria-label={`${formatStardust(value)} d’étoiles`}><CurrencyIcon kind="stardust" />{value.toLocaleString("fr-FR")}</span>;
}
export function EclatsBalance({ value }) {
return <span className="nebula-eclats" aria-label={`${formatEclats(value)} Éclats d’étoile`}><CurrencyIcon kind="eclats" />{formatEclats(value)}</span>;
}