// ── The clans on one server ─────────────────────────────────────────────── // // Rust's OWN clans (R5), best score first. Public at every setting (D58): a // clan's name, colour, score and member count name nobody. Who is IN a clan is // the roster, and that lives on the clan's own page behind the operator's // roster audience (D48). // // **The list is only as good as the board it came from**, and the answer says // how good that is. Three cases would all look like an empty list if rendered // bare, and they are three different sentences: // // • the bridge cannot read this server's clans at all (an older plugin, or a // Nexus server whose clans live elsewhere) — "unavailable"; // • the game's clan system is switched off — "this server has no clans"; // • it can, and there are none — "nobody has founded one yet". // // And a board at the game's 100-clan ceiling (D55) says there may be more. import { Link } from 'react-router-dom' import { ErrorState, Loading, useAsync } from '../core.js' import Empty from './Empty.jsx' import { count } from '../lib/format.js' import api from '../api.js' export default function Clans({ serverId }) { const { data, loading, error } = useAsync(() => api.servers.clans(serverId), [serverId]) if (loading) return if (error) return const clans = (data && data.clans) || [] const board = (data && data.board) || {} if (clans.length === 0) { if (!board.supported) { return ( ) } if (board.enabled === false) { return } return } return ( <> {board.truncated && (

The game lists at most 100 clans, by score, so there may be more on this server than are shown here.

)}
    {clans.map((clan, index) => (
  • {index + 1} {clan.name} {count(clan.memberCount)} {clan.memberCount === 1 ? 'member' : 'members'} {count(clan.score)} pts
  • ))}
) } /** Where a clan's page is: the same template the Team provider hands core. */ export function clanPath(externalId) { return `/rust/clans/${encodeURIComponent(externalId)}` } /** * A clan's colour, as a small square. The server has already checked it is a * `#rrggbb` — it ends up in a style — and a clan with no colour gets an outline * rather than a guess. */ export function Swatch({ color, size = 12 }) { return (