--- // Terminal.astro // A component that displays terminal-like interface with animated commands and outputs interface Command { prompt: string; command: string; output?: string[]; delay?: number; } interface Props { commands: Command[]; title?: string; theme?: 'dark' | 'light'; interactive?: boolean; showTitleBar?: boolean; } const { commands, title = "argobox:~/homelab", theme = "dark", interactive = false, showTitleBar = true } = Astro.props; // Make the last command have the typing effect const lastIndex = commands.length - 1; // Conditionally add classes based on props const terminalClasses = `terminal-box ${theme === 'light' ? 'terminal-light' : ''}`; ---
{showTitleBar && (
{title}
)}
{commands.map((cmd, index) => (
{cmd.prompt} {cmd.command}
{cmd.output && cmd.output.length > 0 && (
{cmd.output.map((line) => (
))}
)}
))} {interactive && (
guest@argobox:~$
)}