UNPKG

@hhoangphuoc/escape-room-cli

Version:

A CLI for playing AI-generated escape room games. Install globally with: npm install -g @hhoangphuoc/escape-room-cli

20 lines (19 loc) 1.15 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import React, { useRef } from 'react'; import { Box, Text } from 'ink'; import Gradient from 'ink-gradient'; import BigText from 'ink-big-text'; const TitleContent = () => { return (_jsxs(Box, { flexDirection: "column", gap: 1, marginBottom: 1, marginTop: 1, children: [_jsx(Box, { justifyContent: "center", marginBottom: 1, paddingBottom: 1, children: _jsx(Gradient, { name: "vice", children: _jsx(BigText, { text: "AI Escape Room" }) }) }), _jsx(Box, { justifyContent: "center", marginTop: 2, paddingTop: 1, children: _jsx(Text, { color: "magenta", children: "\uD83D\uDC49 [ Before you start, Check out /instructions ] \uD83D\uDC48" }) })] })); }; // Aggressive memoization: render once and never update const Title = () => { const renderedRef = useRef(null); // Render only once on mount if (renderedRef.current === null) { renderedRef.current = _jsx(TitleContent, {}); } return renderedRef.current; }; // Additional memoization layer to prevent parent rerender cascades export default React.memo(Title, () => true); // Always return true = never update