import { Context } from "@nuxt/types";
import { AbstractRegistry } from "~/src/registry";
import TaskChildren from './taskSection/TaskChildren.vue';
import Attachments from './taskSection/Attachments.vue';
import Discussion from './taskSection/Discussion.vue';

/**
 * A task section is an individual section within
 * the task view with related settings.
 */
export interface TaskSection {
	name: string;
	icon: string;
	component: any
}

export class TaskSectionRegistry extends AbstractRegistry<TaskSection> {

	public constructor(context: Context) {
		super(context);

		this.register('children', {
			name: 'Task children',
			icon: 'mdi-account-tree',
			component: TaskChildren
		}, 0);

		this.register('attachments', {
			name: 'Attachments',
			icon: 'mdi-link',
			component: Attachments
		}, 10);

		this.register('discussion', {
			name: 'Discussion',
			icon: 'mdi-chat-bubble',
			component: Discussion
		}, 20);

	}
	
}