<template>
	<div />
</template>

<script setup>
defineOptions({
	inheritAttrs: false
})

const toast = useToast()

onMounted(() => {
	const accepted = localStorage.getItem('gdpr-cookies-accepted')
	if (!accepted) {
		toast.add({
			title: 'We use cookies',
			description: 'We use cookies to enhance your browsing experience and analyze site traffic. By clicking "Accept", you consent to our use of cookies.',
			icon: 'i-lucide-cookie',
			timeout: 0,
			actions: [
				{
					label: 'Accept',
					color: 'primary',
					onClick: (e) => {
						e?.stopPropagation()
						localStorage.setItem('gdpr-cookies-accepted', 'true')
						toast.clear()
					}
				},
				{
					label: 'Decline',
					color: 'neutral',
					variant: 'outline',
					onClick: (e) => {
						e?.stopPropagation()
						toast.clear()
					}
				}
			]
		})
	}
})
</script>
