import { Component, OnInit } from '@angular/core';
import { IObjectController } from '@objects-view/interfaces/object-controller';
import { StaticObjectController } from '@objects-view/static-object-controller';
import {
  EditSaml2IdentityProviderComponent
} from '../tabs/edit-saml2-identity-provider/edit-saml2-identity-provider.component';
import { RouterLinkAction } from '@objects-view/actions/router-link-action';
import { Router } from '@angular/router';
import { ConfigService } from '@shared/config/config.service';
import { CallbackAction } from '@objects-view/actions/callback-action';

@Component({
  selector: 'app-saml2-identity-provider-create',
  templateUrl: './saml2-identity-provider-create.component.html',
  styleUrls: ['./saml2-identity-provider-create.component.scss']
})
export class Saml2IdentityProviderCreateComponent implements OnInit {
  public objectController: IObjectController = new StaticObjectController({
    header: {
      title: {
        text: $localize`New SAML 2 identity provider`,
      }
    },
    tabs: [
      {
        tabName: $localize`Create SAML 2 identity provider`,
        tabIdentifier: 'create-saml-2-identity-provider',
        component: EditSaml2IdentityProviderComponent,
      },
    ],
    detailsActions: [
      new RouterLinkAction({
        name: $localize`Cancel`,
        routerUrl: this.config.getPanelUrl(`settings/general`),
        fragment: `single-sign-on`,
        router: this.router,
      }),
      new CallbackAction({
        name:$localize`Add new SAML 2 identity provider`,
      })
    ],
  });

  constructor(private router: Router, private config: ConfigService) {
  }

  ngOnInit(): void {
  }
}
