import { Context } from '@nuxt/types';
import { AbstractRegistry } from '~/src/registry';

export class ProjectSettingsRegistry extends AbstractRegistry<ProjectSettingsTab> {

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

		// General tab
		this.register('general', {
			name: 'PROJECT_SETTINGS_TAB_GENERAL',
			desc: 'Manage general project settings',
			icon: 'mdi mdi-wrench'
		}, 0);

		// Information tab
		this.register('information', {
			name: 'PROJECT_SETTINGS_TAB_INFORMATION',
			desc: 'Manage the project information text',
			icon: 'mdi mdi-text-box'
		}, 10);

		// Members tab
		this.register('members', {
			name: 'PROJECT_SETTINGS_TAB_MEMBERS',
			desc: 'Manage project members and invitations',
			icon: 'mdi mdi-account'
		}, 20);

		// Teams tab
		this.register('teams', {
			name: 'PROJECT_SETTINGS_TAB_TEAMS',
			desc: 'Manage which teams have access',
			icon: 'mdi mdi-account-group'
		}, 30);

		// Features tab
		this.register('components', {
			name: 'Components',
			desc: 'Manage enabled components for this project',
			icon: 'mdi mdi-rocket'
		}, 40);
	}

}

/**
 * A project setting tab represents a single section within
 * the project settings page.
 */
export interface ProjectSettingsTab {
	name: string;
	desc: string;
	icon: string;
}