import { useEffect, useRef, useState, useCallback } from 'react' import { Dialog, DialogContent, DialogTitle, } from '@/components/ui/dialog' import { APP_VERSION } from '@/lib/version' import { BTC_ADDRESS } from '@/routes/_authenticated/about' // ── ANSI Art Content ──────────────────────────────────────────────────────── // Each line is a tuple: [colorClass, text] // Colors reference Deep Space theme via Tailwind utilities type ArtLine = [className: string, text: string] function buildNfoLines(): ArtLine[] { const accent = 'text-accent' const dim = 'text-text-muted' const secondary = 'text-text-secondary' const primary = 'text-text-primary' const bar = '═'.repeat(72) return [ [accent, ''], [accent, ' ████████╗ ██████╗ ██████╗ '], [accent, ' ╚══██╔══╝ ██╔═══██╗ ██╔══██╗'], [accent, ' ██║ ██║ ██║ ██║ ██║'], [accent, ' ██║ ██║ ██║ ██║ ██║'], [accent, ' ██║ ╚██████╔╝ ██████╔╝'], [accent, ' ╚═╝ ╚═════╝ ╚═════╝ '], [accent, ''], [dim, ` ${bar}`], [accent, ''], [primary, ' ▓▒░ T H E O T H E R D U D E ░▒▓'], [secondary, ` ${APP_VERSION} · MSP Fleet Management for RouterOS`], [accent, ''], [dim, ` ${bar}`], [dim, ' ░░░ LICENSE ░░░'], [dim, ` ${bar}`], [accent, ''], [primary, ' Business Source License 1.1'], [accent, ''], [secondary, ' ► Free self-hosted production use up to 250 devices'], [secondary, ' ► SaaS offering requires commercial agreement'], [secondary, ' ► Converts to Apache License 2.0 on March 8, 2030'], [accent, ''], [dim, ' For commercial licensing: license@theotherdude.net'], [dim, ' For support: support@theotherdude.net'], [accent, ''], [dim, ` ${bar}`], [dim, ' ░░░ TECH STACK ░░░'], [dim, ` ${bar}`], [accent, ''], [secondary, ' ► Backend ......... Python / FastAPI / PostgreSQL'], [secondary, ' ► Frontend ........ React / TanStack Router / Tailwind'], [secondary, ' ► Messaging ....... NATS JetStream'], [secondary, ' ► VPN ............. WireGuard'], [secondary, ' ► Deployment ...... Docker Compose / Helm'], [secondary, ' ► Router Comms .... RouterOS Binary API'], [accent, ''], [dim, ` ${bar}`], [dim, ' ░░░ CREDITS ░░░'], [dim, ` ${bar}`], [accent, ''], [primary, ' CookyPuss'], [secondary, ' Built with AI assistance'], [accent, ''], [dim, ` BTC: ${BTC_ADDRESS}`], [accent, ''], [dim, ` ${bar}`], [accent, ''], [accent, ' ░▒▓█ t h e o t h e r d u d e . n e t █▓▒░'], [accent, ''], [dim, ' "Because every MSP needs one."'], [accent, ''], ] } // ── Component ─────────────────────────────────────────────────────────────── interface AnsiNfoModalProps { open: boolean onOpenChange: (open: boolean) => void } export function AnsiNfoModal({ open, onOpenChange }: AnsiNfoModalProps) { const [visibleLines, setVisibleLines] = useState(0) const [animationDone, setAnimationDone] = useState(false) const linesRef = useRef(buildNfoLines()) const intervalRef = useRef | null>(null) const totalLines = linesRef.current.length const skipAnimation = useCallback(() => { if (intervalRef.current) { clearInterval(intervalRef.current) intervalRef.current = null } setVisibleLines(totalLines) setAnimationDone(true) }, [totalLines]) // Start animation when modal opens useEffect(() => { if (!open) { // Reset on close setVisibleLines(0) setAnimationDone(false) if (intervalRef.current) { clearInterval(intervalRef.current) intervalRef.current = null } return } // Animate lines in let count = 0 intervalRef.current = setInterval(() => { count++ setVisibleLines(count) if (count >= totalLines) { clearInterval(intervalRef.current!) intervalRef.current = null setAnimationDone(true) } }, 15) return () => { if (intervalRef.current) { clearInterval(intervalRef.current) intervalRef.current = null } } }, [open, totalLines]) return ( { if (!animationDone && e.key !== 'Escape') { skipAnimation() } }} onClick={() => { if (!animationDone) skipAnimation() }} > {/* Retro title bar */}
TOD.NFO — ACiD View v1.0
{/* Terminal body */}
{/* Screen-reader accessible version */}

The Other Dude, {APP_VERSION}. MSP Fleet Management for RouterOS.

Business Source License 1.1. Free self-hosted production use up to 250 devices. SaaS requires commercial agreement. Converts to Apache 2.0 on March 8 2030.

Built by CookyPuss with AI assistance.

) }