Skip to documentation

Design system / Sources & standards

Current repository source

member-card.tsx

src/components/members/member-card.tsx

This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.

import type { ReactNode } from "react";
import { Badge } from "@/components/ui/badge";
import { Text } from "@/components/ui/text";
import { cn } from "@/lib/utils";
import { memberAccountStatus, memberStatusLabels } from "./member-directory-model";
import type { MemberEntry } from "./types";

export type MemberCardProps = {
  member: MemberEntry;
  showContext?: boolean;
  showStats?: boolean;
  /** The owner composes supported actions; this card has no mutation policy. */
  actions?: ReactNode;
  children?: ReactNode;
};

/** Members-owned molecule: one member's display data and an optional action slot.
 * No list index, directory state, reviewer knowledge, API or removal policy. */
export function MemberCard({ member, showContext, showStats, actions, children }: MemberCardProps) {
  const status = memberAccountStatus(member);
  const label = memberStatusLabels[status];
  return <div data-slot="member-card" className="@container min-w-0 space-y-3 p-3">
    <div data-slot="member-card-header" className="flex min-w-0 items-start gap-2">
    <div className="min-w-0 flex-1 space-y-1">
      <Text variant="supporting" className={cn("break-all font-medium", member.inactive && "line-through text-text-muted")}>{member.displayName || member.email}</Text>
      {member.displayName && <Text variant="supporting" className="break-all text-text-muted">{member.email}</Text>}
    </div>
    {actions && <div className="flex shrink-0 items-center gap-1">{actions}</div>}
    </div>
    <div className="space-y-1">
      <Badge variant={status === "linked" ? "secondary" : "outline"}>{label}</Badge>
      {showContext && member.context && member.context !== label && <Text variant="supporting" className="text-text-muted">{member.context}</Text>}
      {showStats && member.stats && <Text variant="supporting" className="text-text-muted">{member.stats}</Text>}
    </div>
    {children}
  </div>;
}
All sources and standards
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.