Sink-UrlShortener/components/dashboard/Logout.vue
2024-05-25 08:09:30 +08:00

33 lines
895 B
Vue

<script setup>
import { LogOut } from 'lucide-vue-next'
function logOut() {
localStorage.removeItem('SinkSiteToken')
navigateTo('/dashboard/login')
}
</script>
<template>
<AlertDialog>
<AlertDialogTrigger as-child>
<LogOut
class="w-4 h-4 cursor-pointer"
/>
</AlertDialogTrigger>
<AlertDialogContent class="max-w-[95svw] max-h-[95svh] md:max-w-lg grid-rows-[auto_minmax(0,1fr)_auto]">
<AlertDialogHeader>
<AlertDialogTitle>LogOut ?</AlertDialogTitle>
<AlertDialogDescription>
Are you sure you want to log out ?
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction @click="logOut">
LogOut
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
</template>