import {
buildTemplateRecipe,
type TemplateRecipeModel,
type WidgetTemplateConfig,
} from "@radarboard/widget-engine/templates";
import type { WidgetDescriptor } from "@radarboard/widget-sdk/widget-types";
import { kpiRow, list } from "@radarboard/widget-sdk/section-helpers";
const SRC = "project-pulse";
const recipe: TemplateRecipeModel = {
kind: "summary_list",
summary: [
kpiRow(SRC, [
{ label: "Open PRs", field: "openPrs" },
{ label: "Deploys Today", field: "deploysToday" },
]),
],
rail: [],
content: [
list(SRC, "recentEvents", {
title: "title",
subtitle: "timestamp",
emptyMessage: "No recent activity",
}),
],
};
export const PROJECT_PULSE_CONFIG: WidgetTemplateConfig = {
dataSources: [{ id: SRC }],
recipe,
sections: buildTemplateRecipe(recipe),
expandedRecipe: recipe,
expandedSections: buildTemplateRecipe(recipe),
};