/*
 * Copyright 2020-2023 VMware, Inc. All rights reserved. VMware Confidential
 */

import { NgModule } from "@angular/core";
import { Route, RouterModule } from "@angular/router";
import { RESOURCES_ROUTE } from "../../../app/plugin-container/plugin-container.module";
import { ExtensibilityModule } from "../../../common/extensibility/extensibility.module";
import { ExtensionTabContentDirective, ResourcesComponent } from "./resources.component";
import { ExtensionContainerGuard } from "../../../../framework/common/extensibility/extension-container/extension-container-guard";

export const ResourcesRoutesConfiguration: Route = {
    path: RESOURCES_ROUTE,
    children: [
        {
            path: ":resourceExtensionId",
            component: ResourcesComponent,
            canDeactivate: [ExtensionContainerGuard],
        },
    ],
};

@NgModule({
    declarations: [ResourcesComponent, ExtensionTabContentDirective],
    exports: [ResourcesComponent, ExtensionTabContentDirective],
    imports: [RouterModule, ExtensibilityModule],
})
export class ResourceModule {}
