vscode-appwrite/src/tree/projects/ProjectTreeItem.ts
Alex Weininger c3bcd5ff71
Projects view (#4)
* Basic projects view
2021-04-30 00:59:16 -07:00

15 lines
665 B
TypeScript

import { ThemeIcon, TreeItem } from "vscode";
import { AppwriteProjectConfiguration } from "../../settings";
export class ProjectTreeItem extends TreeItem {
constructor(public readonly project: AppwriteProjectConfiguration, active: boolean) {
super("Project");
this.iconPath = new ThemeIcon("rocket");
const name = project.nickname ?? "Project";
this.label = `${name} ${active ? "(Active)" : ""}`;
this.contextValue = `appwriteProject${active ? "_active" : ""}`;
if (!active) {
this.command = { command: "vscode-appwrite.setActiveProject", title: "Set active", arguments: [this] };
}
}
}