11<script setup lang="ts">
22import { SecondaryButton } from ' @/packages/ui/src' ;
33import { ArrowDownTrayIcon , LockClosedIcon } from ' @heroicons/vue/20/solid' ;
4- import Dropdown from ' @/packages/ui/src/Input/Dropdown.vue' ;
4+ import {
5+ DropdownMenu ,
6+ DropdownMenuContent ,
7+ DropdownMenuItem ,
8+ DropdownMenuTrigger ,
9+ } from ' @/Components/ui/dropdown-menu' ;
510import type { ExportFormat } from ' @/types/reporting' ;
611import { ref } from ' vue' ;
712import { isAllowedToPerformPremiumAction } from ' @/utils/billing' ;
@@ -25,32 +30,24 @@ function triggerDownload(format: ExportFormat) {
2530 </script >
2631
2732<template >
28- <Dropdown align = " end " >
29- <template # trigger >
33+ <DropdownMenu >
34+ <DropdownMenuTrigger as-child >
3035 <SecondaryButton :icon =" ArrowDownTrayIcon" :loading > Export </SecondaryButton >
31- </template >
32- <template #content >
33- <div class =" flex flex-col space-y-1 p-1.5" >
34- <SecondaryButton class =" border-0 px-2" @click =" triggerDownload('pdf')" >
35- <div class =" flex items-center space-x-2" >
36- <span > Export as PDF </span >
37- <LockClosedIcon
38- v-if =" !isAllowedToPerformPremiumAction()"
39- class =" w-3.5 text-text-tertiary" ></LockClosedIcon >
40- </div >
41- </SecondaryButton >
42- <SecondaryButton class =" border-0 px-2" @click =" triggerDownload('xlsx')"
43- >Export as Excel</SecondaryButton
44- >
45- <SecondaryButton class =" border-0 px-2" @click =" triggerDownload('csv')"
46- >Export as CSV</SecondaryButton
47- >
48- <SecondaryButton class =" border-0 px-2" @click =" triggerDownload('ods')"
49- >Export as ODS
50- </SecondaryButton >
51- </div >
52- </template >
53- </Dropdown >
36+ </DropdownMenuTrigger >
37+ <DropdownMenuContent align =" end" >
38+ <DropdownMenuItem @click =" triggerDownload('pdf')" >
39+ <div class =" flex items-center space-x-2" >
40+ <span >Export as PDF</span >
41+ <LockClosedIcon
42+ v-if =" !isAllowedToPerformPremiumAction()"
43+ class =" w-3.5 text-text-tertiary" />
44+ </div >
45+ </DropdownMenuItem >
46+ <DropdownMenuItem @click =" triggerDownload('xlsx')" > Export as Excel </DropdownMenuItem >
47+ <DropdownMenuItem @click =" triggerDownload('csv')" > Export as CSV </DropdownMenuItem >
48+ <DropdownMenuItem @click =" triggerDownload('ods')" > Export as ODS </DropdownMenuItem >
49+ </DropdownMenuContent >
50+ </DropdownMenu >
5451 <UpgradeModal v-model:show =" showPremiumModal" >
5552 <strong >PDF Reports</strong > are only available in solidtime Professional.
5653 </UpgradeModal >
0 commit comments