diff --git a/package.json b/package.json index 8c76a5df..87e20c1a 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "next-themes": "^0.3.0", "react-day-picker": "8.10.1", "react-dom": "^18.3.1", + "react-helmet": "^6.1.0", "react-hook-form": "^7.53.0", "react-query": "^3.39.3", "react-resizable-panels": "^2.1.3", @@ -111,6 +112,7 @@ "@types/prismjs": "^1.26.4", "@types/react": "^18.3.9", "@types/react-dom": "^18.3.0", + "@types/react-helmet": "^6.1.11", "@typescript/vfs": "^1.6.0", "@vitejs/plugin-react": "^4.3.1", "autoprefixer": "^10.4.20", diff --git a/src/pages/view-snippet.tsx b/src/pages/view-snippet.tsx index c7c04546..eff7870b 100644 --- a/src/pages/view-snippet.tsx +++ b/src/pages/view-snippet.tsx @@ -10,6 +10,7 @@ import { Share } from "lucide-react" import { useParams } from "wouter" import { PreviewContent } from "@/components/PreviewContent" import Footer from "@/components/Footer" +import { Helmet } from "react-helmet" export const ViewSnippetPage = () => { const { author, snippetName } = useParams() @@ -23,66 +24,71 @@ export const ViewSnippetPage = () => { ) return ( -
-
- {isLoading &&
Loading...
} - {snippetError && snippetError.status === 404 && ( -
- Snippet not found: {author}/{snippetName} -
- )} - {snippetError && snippetError.status !== 404 && ( -
Error: {snippetError.toString()}
- )} - {snippet && ( - <> - -
-
- - - - - } - isStreaming={false} - onCodeChange={() => {}} - onDtsChange={() => {}} - /> -
- + <> + + {`tscircuit - ${author}/${snippetName}`} + +
+
+ {isLoading &&
Loading...
} + {snippetError && snippetError.status === 404 && ( +
+ Snippet not found: {author}/{snippetName}
- - )} -
-
+ )} + {snippetError && snippetError.status !== 404 && ( +
Error: {snippetError.toString()}
+ )} + {snippet && ( + <> + +
+
+ + + + + } + isStreaming={false} + onCodeChange={() => {}} + onDtsChange={() => {}} + /> +
+ +
+ + )} +
+ ) }