mirror of
https://github.com/vercel/streamdown.git
synced 2026-09-19 02:18:37 +08:00
44ae73eaaf
* Initial migration * Update homepage * Delete .source * Fix gitignores * Draft content * Finish drafting content, migrate FAQ * Update code-blocks.tsx * Update route.ts * Update next config * Upgrade to Next.js 16, fix commands * Update layout.tsx
33 lines
783 B
TypeScript
33 lines
783 B
TypeScript
import { SiGithub } from "@icons-pack/react-simple-icons";
|
|
|
|
type EditSourceProps = {
|
|
path: string | undefined;
|
|
};
|
|
|
|
export const EditSource = ({ path }: EditSourceProps) => {
|
|
let url: string | undefined;
|
|
|
|
const owner = process.env.NEXT_PUBLIC_GEISTDOCS_OWNER;
|
|
const repo = process.env.NEXT_PUBLIC_GEISTDOCS_REPO;
|
|
|
|
if (owner && repo && path) {
|
|
url = `https://github.com/${owner}/${repo}/edit/main/content/docs/${path}`;
|
|
}
|
|
|
|
if (!url) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<a
|
|
className="flex items-center gap-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground"
|
|
href={url}
|
|
rel="noopener noreferrer"
|
|
target="_blank"
|
|
>
|
|
<SiGithub className="size-3.5" />
|
|
<span>Edit this page on GitHub</span>
|
|
</a>
|
|
);
|
|
};
|