MDK Logo

Dashboard compositions

Pre-built dashboard compositions and templates

Pre-composed dashboard layouts and templates.

Prerequisites

  • Complete the installation

  • Add the dependency to your app's package.json
{
  "dependencies": {
    "@tetherto/mdk-react-devkit": "*",
    "@tetherto/mdk-react-adapter": "*",
    "@tetherto/mdk-ui-foundation": "*"
  }
}

Run npm install from the mdk/ui workspace root after your app is under apps/ so npm links workspace packages.

  • Import styles: import '@tetherto/mdk-react-devkit/styles.css'

Components

@tetherto/mdk-react-devkit

Import the public APIs on this page from @tetherto/mdk-react-devkit.

ActionsSidebar

Full-height side panel for the reference app voting/approval workflow.

Three sections (only rendered when non-empty): - Draft — locally-staged actions not yet sent to the server. - In review — actions this user submitted, awaiting votes. - Requested — other users' voting actions this user can approve/reject (only shown when the current token has actions:w).

Open/close state is driven by actionsStore.sidebarOpen so the header PendingActionsButton and any in-page code can open it without prop-drilling. Mount this once at the app root — it renders nothing when closed

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/pool-manager/actions-sidebar/actions-sidebar.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Extra class names merged onto the sidebar root element

Cost

Cost Summary - composite reporting page (single-site).

Reads cost-summary view model fields (from useCostSummary) and renders: - page header with "Cost Summary" title and an optional action slot (setCostAction) pinned to the opposite edge - period selector slot (controls) - pass <TimeframeControls> for the OSS-style Year/Month picker or any other date selector element - shared CostContent 2x2 grid (charts + metric tiles)

Multi-site is intentionally out of scope for this extraction wave

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/cost/cost.tsx

Props

PropStatusType / OptionsDefaultDescription
btcPriceLogRequiredreadonly BtcPriceTimeSeriesEntry[]-BTC price time series aligned to costLog buckets
controlsRequiredReact.ReactElement<unknown, string | React.JSXElementConstructor<any>>-Period selector element. Pass <TimeframeControls> for the OSS-style year/month picker
costLogRequiredreadonly CostTimeSeriesEntry[]-Monthly/weekly production-cost time series for the Production Cost / Price chart
dateRangeRequiredFinancialDateRange | null-Active date range; drives x-axis labels across all charts
metricsRequiredCostSummaryDisplayMetrics | null-Headline $/MWh tiles (all-in, energy, operations). Pass null while loading
totalsRequiredCostSummaryMonetaryTotals | null-Period totals (energy + operations USD) for the Operations vs Energy doughnut
avgAllInCostDataOptionalreadonly AvgAllInCostDataPoint[]-Optional revenue/cost time-series for the Avg All-in Cost panel
errorOptionalunknown-When truthy, renders an error message in place of the chart grid
isLoadingOptionalbooleanfalseShows a loading spinner overlay over the chart grid
setCostActionOptionalReact.ReactElement<unknown, string | React.JSXElementConstructor<any>>-Optional "Set Monthly Cost" header action slot. A ReactElement slot (rather than an href string) so consumers can hand in router-aware components like <Link> or <Button onClick={...} /> without triggering a full page reload

CostContent

Renders the data-driven portion of the Cost page in a 2x2 Mosaic grid:

  • (1,1) Production Cost / Price - (1,2) Avg All-in Cost - (2,1) Operations vs Energy Cost - (2,2) Headline metric tiles (stacked)

Exported alongside Cost so consumers who want to embed the cost rendering inside their own page chrome (custom header, layout, navigation) can mount CostContent directly without the default title / "Set Monthly Cost" link

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/cost/cost-content.tsx

Props

PropStatusType / OptionsDefaultDescription
btcPriceLogRequiredreadonly BtcPriceTimeSeriesEntry[]-BTC price time series aligned to costLog buckets
costLogRequiredreadonly CostTimeSeriesEntry[]-Monthly/weekly production-cost time series for the Production Cost / Price chart
dateRangeRequiredFinancialDateRange | null-Active date range; drives x-axis labels across all charts
metricsRequiredCostSummaryDisplayMetrics | null-Headline $/MWh tiles (all-in, energy, operations). Pass null while loading
totalsRequiredCostSummaryMonetaryTotals | null-Period totals (energy + operations USD) for the Operations vs Energy doughnut
avgAllInCostDataOptionalreadonly AvgAllInCostDataPoint[]-Optional revenue/cost time-series for the Avg All-in Cost panel
errorOptionalunknown-When truthy, renders an error message in place of the chart grid
isLoadingOptionalbooleanfalseShows a loading spinner overlay over the chart grid

EnergyReport

Operational Energy report — site consumption trend, power modes by miner type, and per–mining-unit / per–miner-type bar charts

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/operational/energy-report/energy-report.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring--
defaultTabOptional"site-view" | "miner-type-view" | "miner-unit-view"--
minerTypeViewOptionalEnergyReportGroupedBarViewProps--
minerUnitViewOptionalEnergyReportGroupedBarViewProps--
siteViewOptional(Omit<EnergyReportSiteViewProps, "dateRange"> & { dateRange?: EnergyReportDateRange | undefined; })--

HashBalance

Hash balance reporting page — revenue vs cost tabs with site hash revenue, network hashrate, hashprice charts, and integrated timeframe controls

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/financial/hash-balance/hash-balance.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Root layout class
dataOptionalHashRevenueResponse | nullnullRevenue / cost log and summary
errorMessageOptionalstring"Error loading hash balance data. Please try again later."Error copy when isError
initialDateRangeOptionalFinancialDateRangeyear-to-dateInitial period
isErrorOptionalbooleanfalseShow error state
isLoadingOptionalbooleanfalseShow loading state
onDateRangeChangeOptional(dateRange: FinancialDateRange, query: FinanceQueryParams) => void-Fired when the user changes the period
tabsClassNameOptionalstring-Tabs wrapper class
tabsListClassNameOptionalstring-Tab list class

HashBalanceCostPanel

Cost tab panel for hash balance — metric tiles and combined cost / revenue / network hashprice bar chart for the selected period

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/financial/hash-balance/hash-balance-cost-panel.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeRequiredFinancialDateRange-Active reporting window
dataOptionalHashRevenueResponse | nullnullRevenue / cost log and summary payload
isLoadingOptionalbooleanfalseLoading state
logOptionalHashRevenueLogEntry[]-Optional log override
timeframeTypeOptionalnull | "month" | "week" | "year"nullYear / month / week mode

HashBalanceRevenuePanel

Revenue tab panel for hash balance — site hash revenue, network hashrate, hashprice charts, and currency toggle for per-PH/day units

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/financial/hash-balance/hash-balance-revenue-panel.tsx

Props

PropStatusType / OptionsDefaultDescription
currencyRequired"BTC" | "USD"-USD or BTC label for per-PH/day units
dateRangeRequiredFinancialDateRange-Active reporting window
onCurrencyChangeRequired(currency: HashBalanceCurrency) => void-Currency toggle handler
dataOptionalHashRevenueResponse | nullnullRevenue / cost log and summary payload
isLoadingOptionalbooleanfalseLoading state
logOptionalHashRevenueLogEntry[]-Optional log override
timeframeTypeOptionalnull | "month" | "week" | "year"nullYear / month / week mode

OperationalDashboard

Operational dashboard - a 2x2 grid of the four site-operations charts (hashrate, power consumption, site efficiency, miners status). Each card can expand to full width; expand state persists across remounts. Thin glue: pass pre-shaped data from useOperationsDashboard and an optional controls slot (e.g. a date-range picker)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/dashboard/dashboard.tsx

Props

PropStatusType / OptionsDefaultDescription
consumptionOptionalOperationalDashboardTrendInput-Shaped power-consumption trend
controlsOptionalReact.ReactElement<unknown, string | React.JSXElementConstructor<any>>-Optional controls (e.g. a date-range picker) rendered above the grid
efficiencyOptionalOperationalDashboardTrendInput-Shaped site-efficiency trend
hashrateOptionalOperationalDashboardTrendInput-Shaped hashrate trend (LineChartCardData)
minersOptionalOperationalDashboardMinersInput-Shaped stacked miners-status data

PendingActionsButton

Header action tile showing the total count of pending actions (local drafts + submitted voting actions + others' requests). Clicking opens the ActionsSidebar via the shared actionsStore toggle

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/header-actions/pending-actions-button.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Additional class names
onClickOptional((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void)toggles the actions sidebarClick handler override — defaults to toggling the actionsStore sidebar

PoolManager

Composite Pool Manager surface. Owns internal, state-based view switching across the dashboard and the four feature views (Pools, Miner Explorer, Sites Overview, Site Detail) so the whole experience resolves to a single route. Receives all data as props — the shell page is thin glue that reads the adapter hooks and passes them down.

Actions staged from any sub-view (create/edit pool, assign miners) are reviewed via the global ActionsSidebar mounted in App.tsx, opened by the PendingActionsButton in the header toolbar

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/features/pool-manager/pool-manager/pool-manager.tsx

Props

PropStatusType / OptionsDefaultDescription
poolConfigRequiredPoolConfigEntry[]-Pool configurations shared by every sub-view (Pools, Miner Explorer, Sites)
alertsOptionalAlert[]-Recent alerts for the dashboard list
classNameOptionalstring-Additional class names
initialViewOptional"dashboard" | "pools" | "sites-overview" | "miner-explorer" | "site-detail""dashboard"Initial view (defaults to dashboard)
isSiteDetailLoadingOptionalboolean-Site Detail loading flag
isSitesLoadingOptionalboolean-Sites Overview loading flag
isStatsLoadingOptionalboolean-Dashboard stats loading flag
minersOptionalListThingsDevice[][]Miners for the Miner Explorer view
onSiteSelectOptional((unitId: string) => void)-Notified with the selected unit id when a site card is opened
onViewAllAlertsOptionalVoidFunction-Dashboard "View All Alerts" handler (e.g. navigate to /alerts)
onViewChangeOptional((view: PoolManagerView) => void)-Notified whenever the active view changes (lets the page lazy-fetch)
siteDetailDataOptionsOptionalSiteOverviewDetailsDataOptions-Extra data-fetch knobs forwarded to the Site Detail container
siteDevicesOptionalContainerUnit[][]Raw container devices used to resolve the selected unit for Site Detail
sitesErrorOptionalunknown-Sites Overview error
statsOptionalDashboardStats-Dashboard site-level stat blocks
unitsOptionalProcessedContainerUnit[][]Normalised site units for the Sites Overview view
viewOptional"dashboard" | "pools" | "sites-overview" | "miner-explorer" | "site-detail"-Controlled view — when provided the component syncs its internal state to this value whenever it changes (e.g. driven by a URL query param). Leave undefined to rely solely on initialView / internal navigation

PoolManagerDashboard

Landing page for the Pool Manager: site-level stats, primary navigation blocks, and a compact recent-alerts list

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/pool-manager/dashboard/dashboard.tsx

Props

PropStatusType / OptionsDefaultDescription
onNavigationClickRequired(url: string) => void-Called when a navigation block is clicked
onViewAllAlertsRequiredVoidFunction-Called when "View All Alerts" is clicked
alertsOptionalAlert[][]Recent alerts list (capped to MAX_ALERTS_DISPLAYED)
isStatsLoadingOptionalbooleanfalseHide stats while loading
statsOptionalDashboardStats-Top-of-page stat blocks; hidden while loading

PoolManagerSiteOverviewDetails

Pool-manager site detail page — drilldown for a single site showing configured pools, recent miner activity, and performance charts. Renders a breadcrumb header (Site Overview / <unitName>) and delegates the body to SiteOverviewDetailsContainer

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/features/pool-manager/site-overview-details/pool-manager-site-overview-details.tsx

Props

PropStatusType / OptionsDefaultDescription
backButtonClickRequiredVoidFunction-Called when the operator clicks the "Site Overview" back link
poolConfigRequiredPoolConfigEntry[]-Pool configurations powering the per-pool detail rows
unitRequiredUnitData-The site (container unit) to render details for
unitNameRequiredstring-Display name shown in the breadcrumb (Site Overview / <unitName>)
dataOptionsOptionalSiteOverviewDetailsDataOptions-Optional data-fetch knobs forwarded to useSiteOverviewDetailsData
isLoadingOptionalbooleanfalseShow a centered loader instead of the detail container

PoolManagerSitesOverview

Pool-manager sites overview page — landing screen listing every site as a status card with a snapshot of pools, miners online, hashrate, and any active incidents. Each card navigates to the site detail page.

Renders its own loading / empty / error states; safe to render without external guarding

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/features/pool-manager/sites-overview/pool-manager-sites-overview.tsx

Props

PropStatusType / OptionsDefaultDescription
backButtonClickRequiredVoidFunction-Called when the operator clicks the "Pool Manager" back link
onCardClickRequired(unitId: string) => void-Called with the clicked unit id — typically navigates to /sites/:id
poolConfigRequiredPoolConfigEntry[]-Pool configurations powering each card's pool summary
unitsRequiredProcessedContainerUnit[]-Sites to render (already normalised through useSitesOverviewData)
errorOptionalunknown-Shows a "Failed to load data" alert when defined (together with the internal pool-config fetch error)
isLoadingOptionalbooleanfalseShow a skeleton placeholder while site data is fetching

SubsidyFee

Subsidy & fees reporting view — combines a stacked bar chart of mining rewards (subsidy vs fees) with optional summary stat cards and a timeframe selector. Drives data through the companion useSubsidyFees hook and is intended to be embedded inside the financial reporting page

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/subsidy-fee/subsidy-fee.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalSubsidyFeesResponse | null-Subsidy fee data
errorMessageOptionalstring"Error loading block data. Please try again later."Error message to display
isErrorOptionalbooleanfalseShow error state
isLoadingOptionalbooleanfalseShow loading state
logOptionalSubsidyFeesLogEntry[]-Fee log entries
onDateRangeChangeOptional(dateRange: FinancialDateRange, query: FinanceQueryParams) => void-Called when date range changes
showSummaryCardsOptionalbooleanfalseShow summary stat cards

On this page