refacto: cleanning the codebase

This commit is contained in:
Tom Boullay
2026-04-17 16:03:29 +02:00
parent 7e72f1e803
commit 1c48441535
17 changed files with 317 additions and 76 deletions
+5 -3
View File
@@ -1,16 +1,18 @@
import { INTERACT_KEY } from "@/data/keybindings";
import { useCameraMode } from "@/hooks/debug/useCameraMode";
import { useInteraction } from "@/hooks/useInteraction";
import { useInteractionSelector } from "@/hooks/useInteraction";
export function InteractPrompt(): React.JSX.Element | null {
const cameraMode = useCameraMode();
const { focused, holding } = useInteraction();
const focused = useInteractionSelector((state) => state.focused);
const holding = useInteractionSelector((state) => state.holding);
if (cameraMode !== "player") return null;
if (!focused || holding || focused.kind !== "trigger") return null;
return (
<div className="interact-prompt" aria-live="polite">
<kbd className="interact-prompt__key">E</kbd>
<kbd className="interact-prompt__key">{INTERACT_KEY.toUpperCase()}</kbd>
<span className="interact-prompt__label">{focused.label}</span>
</div>
);