24
src/views/components/component.ts
Normal file
24
src/views/components/component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
|
||||
import { Component } from "../../types";
|
||||
import { GithubLocalActionsTreeItem } from "../githubLocalActionsTreeItem";
|
||||
|
||||
export default class ComponentTreeItem extends TreeItem implements GithubLocalActionsTreeItem {
|
||||
static contextValue = 'component';
|
||||
component: Component;
|
||||
|
||||
constructor(component: Component) {
|
||||
super(component.name, TreeItemCollapsibleState.Collapsed);
|
||||
this.component = component;
|
||||
this.collapsibleState = TreeItemCollapsibleState.None;
|
||||
this.contextValue = ComponentTreeItem.contextValue;
|
||||
this.iconPath = new ThemeIcon(component.icon);
|
||||
this.resourceUri = Uri.parse(`${ComponentTreeItem.contextValue}:${component.name}?status=${component.status}`, true);
|
||||
this.tooltip = `Name: ${component.name}\n` +
|
||||
`Status: ${component.status}\n` +
|
||||
(component.message ? `Message: ${component.message}` : ``);
|
||||
}
|
||||
|
||||
async getChildren(): Promise<GithubLocalActionsTreeItem[]> {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user