/**
 * This file is part of Anis Client.
 *
 * @copyright Laboratoire d'Astrophysique de Marseille / CNRS
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

import { Component, Input } from '@angular/core';

import { Instance } from 'src/app/metamodel/models';

/**
 * @class
 * @classdesc Welcome component.
 */
@Component({
    selector: 'app-welcome',
    styleUrls: ['welcome.component.scss'],
    templateUrl: 'welcome.component.html'
})
export class WelcomeComponent {
    @Input() instance: Instance;
    @Input() apiUrl: string;

    /**
     * Returns the logo url.
     *
     * @return string
     */
    getLogoSrc(): string {
        return `${this.apiUrl}/download-instance-file/${this.instance.name}/${this.instance.config.home.home_config.home_component_logo}`;
    }
}