add edit time entry dropdown option to timeentryrow

This commit is contained in:
Gregor Vostrak
2025-08-27 13:09:24 +02:00
parent fb5185a32f
commit c582530899
3 changed files with 54 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { TrashIcon } from '@heroicons/vue/20/solid';
import { TrashIcon, PencilIcon } from '@heroicons/vue/20/solid';
import {
DropdownMenu,
DropdownMenuContent,
@@ -7,7 +7,17 @@ import {
DropdownMenuTrigger,
} from '@/Components/ui/dropdown-menu';
const props = withDefaults(
defineProps<{
showEdit?: boolean;
}>(),
{
showEdit: true,
}
);
const emit = defineEmits<{
edit: [];
delete: [];
}>();
</script>
@@ -33,6 +43,14 @@ const emit = defineEmits<{
</button>
</DropdownMenuTrigger>
<DropdownMenuContent class="min-w-[150px]" align="end">
<DropdownMenuItem
v-if="props.showEdit"
data-testid="time_entry_edit"
class="flex items-center space-x-3 cursor-pointer"
@click="emit('edit')">
<PencilIcon class="w-5" />
<span>Edit</span>
</DropdownMenuItem>
<DropdownMenuItem
data-testid="time_entry_delete"
class="flex items-center space-x-3 cursor-pointer text-destructive focus:text-destructive"