<script lang="ts" setup>
import type { ToasterProps } from 'vue-sonner'
import { Toaster as Sonner } from 'vue-sonner'
import { cn } from '@/lib/utils'

const props = defineProps<ToasterProps>()
</script>

<template>
  <Sonner
    :class="cn('toaster group', props.class)"
    :style="{
      '--normal-bg': 'var(--popover)',
      '--normal-text': 'var(--popover-foreground)',
      '--normal-border': 'var(--border)',
      '--border-radius': 'var(--radius)',
    }"
    v-bind="props"
  >
    <template #success-icon>
      <i class="dku-icon-checkmark-circle-outline-16" />
    </template>
    <template #info-icon>
      <i class="dku-icon-info-circle-outline-16" />
    </template>
    <template #warning-icon>
      <i class="dku-icon-warning-outline-16" />
    </template>
    <template #error-icon>
      <i class="dku-icon-error-circle-outline-16" />
    </template>
    <template #loading-icon>
      <div>
        <i class="dku-icon-arrow-clockwise-16 animate-spin" />
      </div>
    </template>
    <template #close-icon>
      <i class="dku-icon-dismiss-16" />
    </template>
  </Sonner>
</template>
