mirror of
https://github.com/vercel/components.build.git
synced 2026-09-14 20:06:39 +08:00
55fae375a4
* Update Geistdocs * Update geistdocs.tsx * Run translation script * Delete toc.tsx * Update route.ts * Update route.ts
31 lines
736 B
TypeScript
31 lines
736 B
TypeScript
import { SiGithub } from "@icons-pack/react-simple-icons";
|
|
import { github } from "@/geistdocs";
|
|
|
|
type EditSourceProps = {
|
|
path: string | undefined;
|
|
};
|
|
|
|
export const EditSource = ({ path }: EditSourceProps) => {
|
|
let url: string | undefined;
|
|
|
|
if (github.owner && github.repo && path) {
|
|
url = `https://github.com/${github.owner}/${github.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>
|
|
);
|
|
};
|