Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

783 B
Raw Blame
export type MStatus = 'confirmed' | 'pending' | 'info' | 'danger' | 'neutral'

interface MStatusDotProps {
  status: MStatus
  /** Diameter in px */
  size?: number
  className?: string
}

const STATUS_VAR: Record<MStatus, string> = {
  confirmed: 'var(--m-st-confirmed)',
  pending: 'var(--m-st-pending)',
  info: 'var(--m-st-info)',
  danger: 'var(--m-st-danger)',
  neutral: 'var(--m-st-neutral)',
}

/** Status dot in the canonical status colors (confirmed/pending/info/danger/neutral). */
export default function MStatusDot({ status, size = 7, className = '' }: MStatusDotProps) {
  return (
    <span
      aria-hidden
      className={`inline-block flex-none rounded-full ${className}`}
      style={{ width: size, height: size, background: STATUS_VAR[status] }}
    />
  )
}