<template>
    <div class="container">
        <div class="row">
			<span v-for="item in items">
				<div class="col-md-2">
					<a :href="'/entry/' + item.id">
						<img :src="'/assets/store/' + item.id + '/screens/1.png'" width="100px" height="100px" />
						<br />
						{{ item.title }}
					</a>
					<br />
					<a href="/profile/0">
						Name
					</a>
					<br />
					Downloads: {{ item.downloads }}
				</div>
			</span>
        </div>
    </div>
</template>

<script>
    export default {
	name: 'hot-items',
	data: function () {
	    return {
			items: []
	    }
	},
	created: function () {
	    axios.get('/api/rpc/file/gethotfiles').then(data => {
			data.data.forEach(cb => {
				this.items.push({
				'id': cb.id,
				'title': cb.title,
				'downloads': cb.downloads
				});
			});
	    })
	}
    }
</script>

<style>
    .col {
		text-align: center;
    }
</style>