cd78f72f33
Complete rename of all technical identifiers across the codebase: Package names (11 packages): - @planarchy/* → @capakraken/* in all package.json, tsconfig, imports Import statements: 277 files, 548 occurrences replaced Database & Docker: - PostgreSQL user/db: planarchy → capakraken - Docker volumes: planarchy_pgdata → capakraken_pgdata - Connection strings updated in docker-compose, .env, CI CI/CD: - GitHub Actions workflow: all filter commands updated - Test database credentials updated Infrastructure: - Redis channel: planarchy:sse → capakraken:sse - Logger service name: planarchy-api → capakraken-api - Anonymization seed updated - Start/stop/restart scripts updated Test data: - Seed emails: @planarchy.dev → @capakraken.dev - E2E test credentials: all 11 spec files updated - Email defaults: @planarchy.app → @capakraken.app - localStorage keys: planarchy_* → capakraken_* Documentation: 30+ .md files updated Verification: - pnpm install: workspace resolution works - TypeScript: only pre-existing TS2589 (no new errors) - Engine: 310/310 tests pass - Staffing: 37/37 tests pass Co-Authored-By: claude-flow <ruv@ruv.net>
61 lines
2.1 KiB
TypeScript
61 lines
2.1 KiB
TypeScript
"use client";
|
||
|
||
import type { DashboardWidgetType } from "@capakraken/shared/types";
|
||
import { WIDGET_CATALOG } from "./widget-registry.js";
|
||
|
||
interface AddWidgetModalProps {
|
||
onAdd: (type: DashboardWidgetType) => void;
|
||
onClose: () => void;
|
||
}
|
||
|
||
export function AddWidgetModal({ onAdd, onClose }: AddWidgetModalProps) {
|
||
return (
|
||
<div
|
||
className="fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4"
|
||
onClick={(e) => {
|
||
if (e.target === e.currentTarget) onClose();
|
||
}}
|
||
>
|
||
<div className="bg-white rounded-xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col">
|
||
{/* Header */}
|
||
<div className="flex items-center justify-between px-6 py-4 border-b border-gray-200">
|
||
<h2 className="text-lg font-semibold text-gray-900">Add Widget</h2>
|
||
<button
|
||
type="button"
|
||
onClick={onClose}
|
||
className="text-gray-400 hover:text-gray-600 text-2xl leading-none"
|
||
>
|
||
×
|
||
</button>
|
||
</div>
|
||
|
||
{/* Grid of widgets */}
|
||
<div className="flex-1 overflow-y-auto p-6">
|
||
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
||
{WIDGET_CATALOG.map((def) => (
|
||
<button
|
||
key={def.type}
|
||
type="button"
|
||
onClick={() => {
|
||
onAdd(def.type);
|
||
onClose();
|
||
}}
|
||
className="flex items-start gap-4 p-4 border border-gray-200 rounded-xl hover:border-brand-400 hover:bg-brand-50 transition-colors text-left"
|
||
>
|
||
<span className="text-3xl shrink-0">{def.icon}</span>
|
||
<div>
|
||
<div className="font-semibold text-gray-900 text-sm">{def.label}</div>
|
||
<div className="text-xs text-gray-500 mt-1">{def.description}</div>
|
||
<div className="text-xs text-gray-400 mt-1">
|
||
Default: {def.defaultSize.w}×{def.defaultSize.h} grid units
|
||
</div>
|
||
</div>
|
||
</button>
|
||
))}
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
);
|
||
}
|