forked from mem9-ai/mem9
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfront-target-panel.tsx
More file actions
39 lines (34 loc) · 1.24 KB
/
front-target-panel.tsx
File metadata and controls
39 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import type {
PixelFarmInteractionDebugInfo,
} from "@/lib/pixel-farm/create-game";
interface PixelFarmFrontTargetPanelProps {
interactionDebugInfo: PixelFarmInteractionDebugInfo | null;
}
function formatTile(
tile: PixelFarmInteractionDebugInfo["frontTile"],
): string {
if (!tile) {
return "--";
}
return `(${tile.column}, ${tile.row})`;
}
export function PixelFarmFrontTargetPanel({
interactionDebugInfo,
}: PixelFarmFrontTargetPanelProps) {
const target = interactionDebugInfo?.target ?? null;
return (
<aside className="pixel-farm-font rounded-2xl border border-[#f6dca6]/20 bg-[#141109]/88 px-4 py-3 text-[#f6dca6] shadow-2xl backdrop-blur">
<div className="text-[11px] uppercase tracking-[0.24em] text-[#f6dca6]/55">
Front Target
</div>
<div className="mt-2 space-y-1 text-xs">
<div>Current Tile: {formatTile(interactionDebugInfo?.currentTile ?? null)}</div>
<div>Front Tile: {formatTile(interactionDebugInfo?.frontTile ?? null)}</div>
<div>Target ID: {target?.id ?? "--"}</div>
<div>Kind: {target?.kind ?? "--"}</div>
<div>Tag: {target?.tagLabel ?? "--"}</div>
<div>Memories: {target ? target.memoryCount : "--"}</div>
</div>
</aside>
);
}