|
1 | | -import { IconBrandGithub, IconExternalLink } from "@tabler/icons-react"; |
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { |
| 4 | + IconBrandGithub, |
| 5 | + IconExternalLink, |
| 6 | + IconCopy, |
| 7 | + IconCheck, |
| 8 | + IconTerminal, |
| 9 | +} from "@tabler/icons-react"; |
| 10 | +import { Button } from "@/components/ui/button"; |
| 11 | +import { useState } from "react"; |
| 12 | + |
| 13 | +function InlineSnippet({ command }: { command: string }) { |
| 14 | + const [copied, setCopied] = useState(false); |
| 15 | + |
| 16 | + const onCopy = () => { |
| 17 | + if (typeof window === "undefined" || !navigator.clipboard?.writeText) |
| 18 | + return; |
| 19 | + navigator.clipboard.writeText(command).then( |
| 20 | + () => { |
| 21 | + setCopied(true); |
| 22 | + setTimeout(() => setCopied(false), 2000); |
| 23 | + }, |
| 24 | + () => {}, |
| 25 | + ); |
| 26 | + }; |
| 27 | + |
| 28 | + return ( |
| 29 | + <div className="bg-muted relative w-full overflow-hidden rounded-md border text-left"> |
| 30 | + <div className="flex items-center gap-2 px-3 py-2"> |
| 31 | + <IconTerminal size={16} className="text-muted-foreground" /> |
| 32 | + <div className="flex-1 overflow-x-auto text-left"> |
| 33 | + <code className="font-mono text-sm whitespace-nowrap md:text-base"> |
| 34 | + {command} |
| 35 | + </code> |
| 36 | + </div> |
| 37 | + <Button |
| 38 | + onClick={onCopy} |
| 39 | + size="icon" |
| 40 | + variant="ghost" |
| 41 | + aria-label={copied ? "Copied" : "Copy"} |
| 42 | + > |
| 43 | + {copied ? <IconCheck size={16} /> : <IconCopy size={16} />} |
| 44 | + </Button> |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + ); |
| 48 | +} |
2 | 49 |
|
3 | 50 | export default function Home() { |
4 | 51 | return ( |
5 | | - <> |
| 52 | + <div className="flex min-h-[calc(100dvh-var(--header-height,56px))] flex-col"> |
6 | 53 | <div className="mx-auto mt-20 max-w-screen-md px-4"> |
7 | 54 | <div className="flex flex-col items-center gap-6 text-center"> |
8 | 55 | <img |
9 | 56 | src="https://raw.githubusercontent.com/proofgeist/proofkit/dde6366c529104658dfba67a8fc2910a8644fc64/docs/src/assets/proofkit.png" |
10 | 57 | alt="ProofKit" |
11 | 58 | className="h-auto max-h-64 w-auto" |
12 | 59 | /> |
13 | | - <h1 className="text-3xl font-bold">Welcome!</h1> |
| 60 | + <h1 className="text-foreground text-3xl font-bold">Welcome!</h1> |
14 | 61 |
|
15 | | - <p className="text-balance text-base text-zinc-700 dark:text-zinc-300"> |
| 62 | + <p className="text-muted-foreground text-base text-balance"> |
16 | 63 | This is the base template home page. To add more pages, components, |
17 | 64 | or other features, run the ProofKit CLI from within your project. |
18 | 65 | </p> |
19 | | - <code className="rounded bg-zinc-100 px-2 py-1 font-mono text-sm dark:bg-zinc-800"> |
20 | | - __PNPM_COMMAND__ proofkit |
21 | | - </code> |
22 | 66 |
|
23 | | - <p className="text-balance text-base text-zinc-700 dark:text-zinc-300"> |
| 67 | + <InlineSnippet command="pnpm proofkit" /> |
| 68 | + |
| 69 | + <p className="text-muted-foreground text-base text-balance"> |
24 | 70 | To change this page, open <code>src/app/(main)/page.tsx</code> |
25 | 71 | </p> |
26 | 72 | <div> |
27 | | - <a |
28 | | - href="https://proofkit.dev" |
29 | | - target="_blank" |
30 | | - rel="proofkit-app" |
31 | | - className="inline-flex items-center gap-1 text-blue-600 hover:underline" |
32 | | - > |
33 | | - ProofKit Docs <IconExternalLink size={16} /> |
34 | | - </a> |
| 73 | + <Button asChild variant="outline"> |
| 74 | + <a href="https://proofkit.dev" target="_blank" rel="noreferrer"> |
| 75 | + ProofKit Docs <IconExternalLink size={16} /> |
| 76 | + </a> |
| 77 | + </Button> |
35 | 78 | </div> |
36 | 79 | </div> |
37 | 80 | </div> |
38 | | - <footer className="mt-10 border-t border-zinc-200 py-4 dark:border-zinc-800"> |
| 81 | + <div className="border-border mt-auto border-t py-4"> |
39 | 82 | <div className="mx-auto flex max-w-screen-md items-center justify-between px-4"> |
40 | | - <div className="text-sm text-zinc-600 dark:text-zinc-400"> |
41 | | - Sponsored by {" "} |
| 83 | + <div className="text-muted-foreground text-sm"> |
| 84 | + Sponsored by{" "} |
42 | 85 | <a |
43 | 86 | href="https://proofgeist.com" |
44 | 87 | target="_blank" |
45 | 88 | rel="proofkit-app" |
46 | | - className="underline" |
| 89 | + className="text-foreground hover:text-primary underline" |
47 | 90 | > |
48 | 91 | Proof+Geist |
49 | 92 | </a>{" "} |
50 | | - and {" "} |
| 93 | + and{" "} |
51 | 94 | <a |
52 | 95 | href="https://ottomatic.cloud" |
53 | 96 | target="_blank" |
54 | 97 | rel="proofkit-app" |
55 | | - className="underline" |
| 98 | + className="text-foreground hover:text-primary underline" |
56 | 99 | > |
57 | 100 | Ottomatic |
58 | 101 | </a> |
59 | 102 | </div> |
60 | 103 | <div> |
61 | | - <a href="https://github.com/proofgeist/proofkit" target="_blank" className="text-zinc-600 hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-white"> |
| 104 | + <a |
| 105 | + href="https://github.com/proofgeist/proofkit" |
| 106 | + target="_blank" |
| 107 | + className="text-muted-foreground hover:text-foreground" |
| 108 | + > |
62 | 109 | <IconBrandGithub size={20} /> |
63 | 110 | </a> |
64 | 111 | </div> |
65 | 112 | </div> |
66 | | - </footer> |
67 | | - </> |
| 113 | + </div> |
| 114 | + </div> |
68 | 115 | ); |
69 | 116 | } |
0 commit comments