import { Component, Prop } from 'vue-property-decorator';
import { Game } from '../../../../../_common/game/game.model';
import { GameScreenshot } from '../../../../../_common/game/screenshot/screenshot.model';
import { GameVideo } from '../../../../../_common/game/video/video.model';
import { BaseModal } from '../../../../../_common/modal/base';
import AppNavTabList from '../../../../../_common/nav/tab-list/tab-list.vue';
import FormGameImage from '../../../forms/game/image/image.vue';
import FormGameVideo from '../../../forms/game/video/video.vue';

@Component({
	components: {
		AppNavTabList,
		FormGameImage,
		FormGameVideo,
	},
})
export default class AppGameMediaItemAddModal extends BaseModal {
	@Prop(Game) game!: Game;

	tab: 'image' | 'video' ;

	onImagesAdd(_model: any, response: any) {
		this.modal.resolve(GameScreenshot.populate(response.screenshots));
	}

	onVideoAdd(video: GameVideo) {
		this.modal.resolve([video]);
	}

}
