45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import type { PluginClientContext, PluginSidebarItemProps } from "@getpaseo/plugin/client";
|
|
import { SidebarRow } from "@getpaseo/plugin/client/ui";
|
|
import { GitCloneScreen } from "./client/git-clone";
|
|
|
|
function GitCloneItem({ currentScreen, openScreen }: PluginSidebarItemProps) {
|
|
return (
|
|
<SidebarRow
|
|
icon="FolderGit2"
|
|
label="Clone from Git URL"
|
|
active={currentScreen?.screenId === "clone"}
|
|
onPress={() => openScreen({ screenId: "clone" })}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default function contribute(client: PluginClientContext) {
|
|
client.addScreen({ id: "clone", title: "Clone from Git URL", Component: GitCloneScreen });
|
|
client.addSidebarFooterItem({
|
|
id: "clone",
|
|
title: "Clone from Git URL",
|
|
Component: GitCloneItem,
|
|
});
|
|
client.addCommandCenterItem({
|
|
id: "clone-from-git-url",
|
|
title: "Clone from Git URL",
|
|
icon: "FolderGit2",
|
|
keywords: [
|
|
"git",
|
|
"clone",
|
|
"url",
|
|
"repository",
|
|
"repo",
|
|
"github",
|
|
"gitlab",
|
|
"gitea",
|
|
"project",
|
|
],
|
|
context: "global",
|
|
onSelect({ openScreen }) {
|
|
openScreen({ screenId: "clone" });
|
|
},
|
|
});
|
|
return () => {};
|
|
}
|