sokko-g/website/src/features/cards/admin/DateValue.jsx
Shinuwa 5ce35cd7ba Add the Sokko TCG collectible card mini-game
Add the server-backed card game: Discord login, recharging pack openings,
album, trades, gifts, stardust shop, campaign codes and its administration,
stored in SQLite and disabled in production until configured.

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

10 lines
664 B
JavaScript

// Rôle : affiche une date accessible dans l'administration Sokko TCG.
import { Tooltip } from "../../../components/Tooltip.jsx";
import { DATE_FORMATTER, SHORT_DATE_FORMATTER } from "./adminFormat.js";
// `relative` remplace le texte visible (« il y a 5 minutes ») ; la date complète reste en infobulle.
export function DateValue({ value, empty = "Aucun tirage", dateOnly = false, relative = null }) {
if (!value) return <span>{empty}</span>;
const full = (dateOnly ? SHORT_DATE_FORMATTER : DATE_FORMATTER).format(value);
return <Tooltip as="time" dateTime={new Date(value).toISOString()} content={relative ? full : ""}>{relative || full}</Tooltip>;
}