2022-03-11 19:06:06 -05:00
|
|
|
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
2023-02-13 20:12:31 -05:00
|
|
|
import { Env, StateService } from '../../services/state.service';
|
2022-02-07 13:25:36 -05:00
|
|
|
import { restApiDocsData } from './api-docs-data';
|
2022-03-26 09:09:37 -04:00
|
|
|
import { faqData } from './api-docs-data';
|
2021-12-16 19:11:54 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-api-docs-nav',
|
|
|
|
templateUrl: './api-docs-nav.component.html',
|
|
|
|
styleUrls: ['./api-docs-nav.component.scss']
|
|
|
|
})
|
|
|
|
export class ApiDocsNavComponent implements OnInit {
|
|
|
|
|
|
|
|
@Input() network: any;
|
2022-03-26 09:09:37 -04:00
|
|
|
@Input() whichTab: string;
|
2022-03-11 19:06:06 -05:00
|
|
|
@Output() navLinkClickEvent: EventEmitter<any> = new EventEmitter();
|
2023-02-13 20:12:31 -05:00
|
|
|
env: Env;
|
2022-03-26 09:09:37 -04:00
|
|
|
tabData: any[];
|
2023-02-13 20:12:31 -05:00
|
|
|
officialMempoolInstance: boolean;
|
2021-12-16 19:11:54 -05:00
|
|
|
|
2023-02-13 20:12:31 -05:00
|
|
|
constructor(
|
|
|
|
private stateService: StateService
|
|
|
|
) { }
|
2021-12-16 19:11:54 -05:00
|
|
|
|
|
|
|
ngOnInit(): void {
|
2023-02-13 20:12:31 -05:00
|
|
|
this.env = this.stateService.env;
|
|
|
|
this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE;
|
2022-07-05 04:30:05 -07:00
|
|
|
if (this.whichTab === 'rest') {
|
2022-03-26 09:09:37 -04:00
|
|
|
this.tabData = restApiDocsData;
|
2022-07-05 04:30:05 -07:00
|
|
|
} else if (this.whichTab === 'faq') {
|
2022-03-26 09:09:37 -04:00
|
|
|
this.tabData = faqData;
|
|
|
|
}
|
2021-12-16 19:11:54 -05:00
|
|
|
}
|
2022-07-05 04:30:05 -07:00
|
|
|
|
|
|
|
navLinkClick(event) {
|
|
|
|
this.navLinkClickEvent.emit(event);
|
2022-03-11 19:06:06 -05:00
|
|
|
}
|
2021-12-16 19:11:54 -05:00
|
|
|
|
|
|
|
}
|