Collection
Business / HR & People · v0.2.0Validated
Spot aging requisitions and inspect each role’s lead, openings and pipeline.
Hiring Requisition Tracker · Preview
Loading widget…
Preparing source code…
Idle
Business / HR & People · v0.2.0Validated
Spot aging requisitions and inspect each role’s lead, openings and pipeline.
Loading widget…
Preparing source code…
Load the Lumo theme once in your app entry point. The example uses the local Lumo workspace packages.
import "@lumo/tokens/tokens.css";
import { OpenRolesWidget } from "@lumo/widgets/catalog/hr/open-roles";
export default function Example() {
return <OpenRolesWidget />;
}Props for integrating the React component in your app.
snapshotOpenRolesSnapshot | null (optional){
"snapshot": {
"period": "Active requisitions",
"staleAfterDays": 35,
"roles": [
{
"id": "H-19",
"title": "Accessibility Engineer",
"team": "Platform",
"daysOpen": 42,
"openings": 2,
"hiringManager": "Nico March",
"pipeline": {
"applied": 18,
"screen": 6,
"interview": 2,
"offer": 0
}
}
]
}
}"use client";
import { BriefcaseBusiness } from "lucide-react";
import { nonnegativeInteger } from "../../shared/operation-snapshot";
import { WidgetOperations, type OperationRow } from "../../shared/WidgetOperations";
import { openRolesDemo } from "./open-roles.constants";
import type { OpenRolesSnapshot } from "./open-roles.types";
export type { OpenRolesSnapshot, HiringRole } from "./open-roles.types";
export function OpenRolesWidget({ snapshot = openRolesDemo }: { index?: number; snapshot?: OpenRolesSnapshot | null } = {}) {
const roles = snapshot?.roles.slice().sort((a, b) => (b.daysOpen ?? -1) - (a.daysOpen ?? -1));
const count = (n: number | null) => nonnegativeInteger(n) ? String(n) : "Unavailable";
return <WidgetOperations title="Open Roles" icon={<BriefcaseBusiness />} description={snapshot?.period}
empty="No open roles" summary={roles && <><strong>{roles.length}</strong><span>open requisitions</span></>}
rows={roles?.map<OperationRow<never>>(role => ({
id: role.id, label: role.title, caption: role.team,
person: role.hiringManager ? { name: role.hiringManager, avatarUrl: role.avatarUrl } : undefined,
value: nonnegativeInteger(role.daysOpen) ? `${role.daysOpen} d` : "Age unavailable",
status: nonnegativeInteger(snapshot?.staleAfterDays) && nonnegativeInteger(role.daysOpen) && role.daysOpen >= snapshot.staleAfterDays
? { label: "Aging", tone: "warning" } : undefined,
details: [["Hiring lead", role.hiringManager ?? "Not assigned"], ["Openings", count(role.openings)], ["Applied", count(role.pipeline.applied)],
["Screening", count(role.pipeline.screen)], ["Interview", count(role.pipeline.interview)], ["Offer", count(role.pipeline.offer)]],
})) ?? null} />;
}
lucide-reactmotionreactreact-dom