MDK Logo

Log components

Components for displaying log entries and activity feeds

Log components

Components for displaying log entries, activity feeds, and event histories.

Prerequisites

Before using these components, complete the @mdk/core installation and add the dependency.

LogsCard

Container for displaying a list of log entries with pagination.

Import

import { LogsCard } from '@mdk/core'

Props

PropTypeDefaultDescription
logsDataLogData[][]Array of log entries
typestringnoneLog type identifier
labelstringnoneCard label
isLoadingbooleanfalseShow loading skeleton
isDarkbooleanfalseDark theme variant
emptyMessagestring'No incidents'Empty state message
skeletonRowsnumber5Number of skeleton rows
paginationLogPaginationnonePagination configuration
onLogClickedfunctionnoneLog click callback

LogData type

type LogData = {
  uuid: string
  body: string
  title: string
  status: string
  subtitle: string
}

LogPagination type

type LogPagination = {
  current: number
  total: number
  pageSize: number
  handlePaginationChange: (page: number) => void
}

Basic usage

const logs = [
  {
    uuid: '1',
    title: 'Miner Offline',
    subtitle: 'Site A - Rack 12',
    body: 'Miner 001 went offline at 14:32',
    status: 'error',
  },
  {
    uuid: '2',
    title: 'Hashrate Drop',
    subtitle: 'Site B - Rack 5',
    body: 'Hashrate dropped below threshold',
    status: 'warning',
  },
]

<LogsCard
  label="Recent Incidents"
  logsData={logs}
  type="incident"
  onLogClicked={(uuid) => handleLogClick(uuid)}
/>

With pagination

const [page, setPage] = useState(1)

<LogsCard
  label="Activity Log"
  logsData={logs}
  type="activity"
  pagination={{
    current: page,
    total: 100,
    pageSize: 10,
    handlePaginationChange: setPage,
  }}
/>

Loading state

<LogsCard
  label="Loading..."
  isLoading
  skeletonRows={5}
/>

Styling

  • .mdk-logs-card: Root container
  • .mdk-logs-card__inner-container: Content wrapper
  • .mdk-logs-card__list-container: Log list container
  • .mdk-logs-card__pagination: Pagination area
  • .mdk-logs-card__empty: Empty state container

LogRow

Renders an individual log entry row.

Import

import { LogRow } from '@mdk/core'

Props

PropTypeDefaultDescription
logLogDatanoneRequired: Log entry data
typestringnoneRequired: Log type identifier
styleCSSPropertiesnoneCustom styles
onLogClickedfunctionnoneClick callback

Basic usage

<LogRow
  log={{
    uuid: '1',
    title: 'System Alert',
    subtitle: 'High temperature detected',
    body: 'Rack 5 temperature exceeded 80°C',
    status: 'warning',
  }}
  type="alert"
  onLogClicked={(uuid) => viewDetails(uuid)}
/>

LogItem

Compact log item display.

Import

import { LogItem } from '@mdk/core'

Props

PropTypeDefaultDescription
dataLogDatanoneRequired: Log entry data
onLogClickedfunctionnoneClick callback

Basic usage

<LogItem
  data={{
    uuid: '1',
    title: 'Configuration Change',
    subtitle: 'Pool settings updated',
    body: 'Primary pool changed to us-east',
    status: 'info',
  }}
/>

LogDot

Status indicator dot for log entries.

Import

import { LogDot } from '@mdk/core'

Props

PropTypeDefaultDescription
typestringnoneLog type identifier
statusstringnoneStatus value

Basic usage

<LogDot type="incident" status="error" />
<LogDot type="activity" status="success" />
<LogDot type="alert" status="warning" />

ActivityLogIcon

Icon for activity log entries.

Import

import { ActivityLogIcon } from '@mdk/core'

Props

PropTypeDefaultDescription
statusstringnoneStatus value

Basic usage

<ActivityLogIcon status="online" />
<ActivityLogIcon status="offline" />
<ActivityLogIcon status="warning" />

Status values

Log components support the following status values:

StatusColorUse case
successGreenSuccessful operations
errorRedErrors, failures
warningYellowWarnings, alerts
infoBlueInformational
defaultGrayNeutral/unknown

On this page