mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-01-23 03:07:05 +00:00
31 lines
672 B
TypeScript
31 lines
672 B
TypeScript
import { IconButton } from '~/components/ui/IconButton';
|
|
import { useGit } from '~/lib/hooks/useGit';
|
|
|
|
export default function GitCloneButton() {
|
|
const { ready, gitClone } = useGit();
|
|
const onClick = async (_e: any) => {
|
|
if (!ready) {
|
|
return;
|
|
}
|
|
|
|
const repoUrl = prompt('Enter the Git url');
|
|
|
|
if (repoUrl) {
|
|
await gitClone(repoUrl);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<IconButton
|
|
onClick={(e) => {
|
|
onClick(e);
|
|
}}
|
|
className="w-full justify-center"
|
|
title="Clone A Git Repo"
|
|
>
|
|
<span className="mr-2 text-xs lg:text-sm">Clone A Git Repo</span>
|
|
<div className="i-ph:git-branch" />
|
|
</IconButton>
|
|
);
|
|
}
|