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.

1.1 KB
Raw Blame
import { ReactNode } from 'react'
import type { LucideIcon } from 'lucide-react'

interface MListRowProps {
  label: ReactNode
  icon?: LucideIcon
  trailing?: ReactNode
  danger?: boolean
  onClick?: () => void
  className?: string
  /** The row is the one open now (a chat in a history list), said so to a screen reader too. */
  current?: boolean
}

/** Menu/list row (user menu style): icon 16 in --m-muted, 13.5px semibold label. */
export default function MListRow({
  label,
  icon: Icon,
  trailing,
  danger = false,
  onClick,
  className = '',
  current = false,
}: MListRowProps) {
  return (
    <button
      type="button"
      onClick={onClick}
      aria-current={current || undefined}
      className={`flex w-full items-center gap-[11px] rounded-xl px-[10px] py-[11px] text-start text-[0.84375rem] font-semibold active:bg-[color:var(--m-ic)] ${
        danger ? 'text-[color:var(--m-st-danger)]' : 'text-m-ink'
      } ${className}`}
    >
      {Icon && <Icon size={16} strokeWidth={2} className={danger ? '' : 'text-m-muted'} />}
      <span className="min-w-0 flex-1 truncate">{label}</span>
      {trailing}
    </button>
  )
}