Files
github-local-actions/src/views/components/component.ts
Sanjula Ganepola c6b960c60b rename view
Signed-off-by: Sanjula Ganepola <sanjulagane@gmail.com>
2024-09-24 23:50:41 -04:00

24 lines
1.0 KiB
TypeScript

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 [];
}
}