a6eb6ec788
- Extract DashboardSummary, ActiveSessionsList, ProjectsSection, QuickCreateForm, RecentSessionsSection from dashboard.tsx (480 → 110 lines) - Extract WorkspaceSidebar from repo-workspace.tsx - Extract ToolTypeList + ToolTypeForm from tool-types.tsx (409 → 135 lines) - Extract ToolConfigList + ToolConfigForm from tool-configs.tsx (391 → 178 lines) - Add use-dashboard-actions hook for shared dashboard action handlers - Update feature barrels with new exports Quality gates: tsc (pass), eslint (pass) Refs: repo-restructure Task 4.3
35 lines
893 B
TypeScript
35 lines
893 B
TypeScript
import type { DashboardSummary as DashboardSummaryType } from "../../../api/dashboard";
|
|
|
|
interface DashboardSummaryProps {
|
|
summary: DashboardSummaryType;
|
|
activeSessionsCount: number;
|
|
}
|
|
|
|
const summaryCards = [
|
|
{ label: "Open sessions", key: "openSessions" },
|
|
{ label: "Projects", key: "projects" },
|
|
{ label: "Repositories", key: "repositories" },
|
|
] as const;
|
|
|
|
export const DashboardSummary = ({
|
|
summary,
|
|
activeSessionsCount,
|
|
}: DashboardSummaryProps) => {
|
|
return (
|
|
<div className="home-summary-grid">
|
|
{summaryCards.map((card) => (
|
|
<article className="card home-summary-card" key={card.label}>
|
|
<p className="card-label">{card.label}</p>
|
|
<p className="card-value">
|
|
{card.key === "openSessions"
|
|
? activeSessionsCount
|
|
: card.key === "projects"
|
|
? summary.projects
|
|
: summary.repositories}
|
|
</p>
|
|
</article>
|
|
))}
|
|
</div>
|
|
);
|
|
};
|