'use client'; import React from 'react'; import { Club, UserPortalPermissions } from './types'; interface ClubMastheadProps { club: Club; permissions: UserPortalPermissions; onPlanRide?: () => void; onInviteMember?: () => void; onOpenSettings?: () => void; } export function ClubMasthead({ club, permissions, onPlanRide, onInviteMember, onOpenSettings, }: ClubMastheadProps) { // Deterministic 2-4 character monogram const monogram = club.name .split(/\s+/) .filter(Boolean) .map((w) => w[0].toUpperCase()) .slice(0, 3) .join('') || 'MS'; const visibilityLabel = club.visibility === 'public' ? 'Public' : 'Private'; const admissionLabel = club.admissionPolicy === 'inviteOnly' ? 'Invite Only' : club.admissionPolicy === 'open' ? 'Open to Join' : 'Request to Join'; return (
{/* Left: Identity & Monogram */}
{/* Precision Hex Monogram Emblem */}
{monogram}
{/* Titles and Club Attributes */}

{club.name}

{visibilityLabel} {admissionLabel}
@{club.slug} {club.homeRegion && ( <> • {club.homeRegion} )} {club.foundedYear && ( <> • Founded {club.foundedYear} )} {club.motorcycleFocus && ( <> • {club.motorcycleFocus} )}
{/* Founder Attribution Sub-strip */}
Founder: {club.founderName ?? 'Club Founder'} {club.founderHandle && ( ({club.founderHandle}) )}
•
Club Rank: {club.founderRank ?? 'President'}
•
Administrative Role: {permissions.role.charAt(0).toUpperCase() + permissions.role.slice(1)}
{/* Right: Founder Actions (Role-gated) */}
{permissions.canPlanRides && ( )} {permissions.canInviteMembers && ( )} {permissions.canManageSettings && ( )}
); }