<template>
	<NcAppNavigationList class="list">
		<NcAppNavigationNewItem
			:name="t('repod', 'Add a RSS link')"
			@new-item="(url: string) => $router.push(toFeedUrl(url))">
			<template #icon>
				<PlusIcon :size="20" />
			</template>
		</NcAppNavigationNewItem>
	</NcAppNavigationList>
</template>

<script lang="ts">
import { NcAppNavigationList, NcAppNavigationNewItem } from '@nextcloud/vue'
import PlusIcon from 'vue-material-design-icons/Plus.vue'
import { t } from '@nextcloud/l10n'
import { toFeedUrl } from '../../utils/url.ts'

export default {
	name: 'AddRss',
	components: {
		NcAppNavigationList,
		NcAppNavigationNewItem,
		PlusIcon,
	},
	methods: {
		t,
		toFeedUrl,
	},
}
</script>

<style scoped>
.list {
	margin-top: 2rem;
}
</style>
