import vscode from 'vscode';
import { MergeRequestModel } from '../../coding/mergeRequestModel';
import { TreeNode, TreeNodeParent } from './treeNode';

export class DescriptionNode extends TreeNode implements vscode.TreeItem {
	public command?: vscode.Command;
	public contextValue?: string;
	public tooltip: string;

	constructor(
		// public parent: TreeNodeParent,
		public label: string,
		public iconPath:
			| string
			| vscode.Uri
			| { light: string | vscode.Uri; dark: string | vscode.Uri }
			| vscode.ThemeIcon,
		public mergeRequestModel: MergeRequestModel,
	) // public readonly repository: Repository
	{
		super();

		this.command = {
			title: 'View Pull Request Description',
			command: 'pr.openDescription',
			arguments: [this],
		};

		this.tooltip = `Description of pull request ${mergeRequestModel.mergeId}`;
		this.accessibilityInformation = {
			label: `Merge request page of pull request number ${mergeRequestModel.mergeId}`,
			role: 'button',
		};
	}

	getTreeItem(): vscode.TreeItem {
		return this;
	}
}
