<template>
	<div class="main">
		<p>
			<NcTextField :value.sync="search" :label="t('Find a podcast')">
				<Magnify :size="20" />
			</NcTextField>
		</p>
		<Search v-if="search" :value="search" />
		<TopList v-if="!search" />
		<AddRss v-if="!search" />
	</div>
</template>

<script>
import AddRss from '../components/AddRss.vue'
import Magnify from 'vue-material-design-icons/Magnify.vue'
import { NcTextField } from '@nextcloud/vue'
import Search from '../components/Search.vue'
import TopList from '../components/TopList.vue'

export default {
	name: 'Discover',
	components: {
		AddRss,
		Magnify,
		NcTextField,
		Search,
		TopList,
	},
	data() {
		return {
			search: '',
		}
	},
}
</script>

<style scoped>
	.main {
		margin: 15px 51px;
		display: flex;
		flex-direction: column;
		gap: 1rem;
	}
</style>
