"use client"; import { useEffect, useRef, useState } from "react"; import { Chip, GlassFace, IconButton, Tooltip } from "@unlocalhosted/metalui"; import { MorphIcon } from "./icons"; /** * The landing page's terminal: MetalUI's code card look (a glass bezel round a dark screen, a glass tag * with the code LED) holding a first push, with a copy key for the two commands. */ export function HomeTerminal({ sshUrl }: { sshUrl: string }) { const snippet = `git remote add origin ${sshUrl}\ngit push -u origin main`; const [copied, setCopied] = useState(false); const timer = useRef>(undefined); useEffect(() => () => clearTimeout(timer.current), []); return ( Terminal · zsh · ~/project
} className={`${copied ? "text-code-card-tint-string!" : "text-code-card-tint-comment!"} hover:bg-white/10! hover:text-code-card-code-ink!`} onClick={async () => { await navigator.clipboard.writeText(snippet); setCopied(true); clearTimeout(timer.current); timer.current = setTimeout(() => setCopied(false), 1500); }} />
          ❯ git remote add origin {sshUrl}
          {"\n"}
          ❯ git push -u origin main
          {"\n"}
          Enumerating objects: 42, done.
          {"\n"}
          Writing objects: 100% (42/42), 8.13 KiB | 8.13 MiB/s, done.
          {"\n"}
          To {sshUrl.replace("git@", "")}
          {"\n"}
           * [new branch]      main → main
        
); }