<script lang="ts">
import { defineComponent } from 'vue'
import { config } from '@/main'
import { useRouter } from 'vue-router'

export default defineComponent({
	name: 'ProfileVideo',
	props: {
		id: {
			type: Number,
			required: true,
		},
		accountId: {
			type: String,
			required: true
		}
	},
	data() {
		return {
			config,
		}
	},
	setup() {
		const router = useRouter();
		return { router }
	},
})
</script>

<template>
	<div class="explore-video" @click="this.router.push(`/profile/${accountId}/videos?video=${id}`)">
		<img :src="`${config.serverURL}/video/${id}/thumbnail`" class="explore-video-thumbnail" />
	</div>
</template>

<style scoped>
.explore-video {
	border-radius: 15px;
	border: 2px solid var(--accent-color);
	width: 200px;
	height: 300px;
}

@media screen and (max-width: 768px) {
	.explore-video {
		width: 100px;
		height: 200px;
	}
}

.explore-video:hover {
	cursor: pointer;
	animation-name: interaction;
	animation-duration: 1s;
	animation-iteration-count: infinite;
}

.explore-video-thumbnail {
	border-radius: 15px;
	width: 100%;
	height: 100%;
}
</style>
