<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 />
					{{ item.submit_date }}
				</div>
			</span>
        </div>
    </div>
</template>

<script>
    import moment from 'moment';
    export default {
		name: 'new-items',
		data: function () {
			return {
				items: []
			}
		},
		created: function () {
			axios.get('/api/rpc/file/getnewfiles').then(data => {
				data.data.forEach(cb => {
					this.items.push({
					'id': cb.id,
					'title': cb.title,
					'submit_date': moment.unix(cb.submit_date).format("YYYY/MM/DD")
					});
				});
			})
		}
    }
</script>

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