refactor: simplify order show page header by removing print, edit, and status action buttons
This commit is contained in:
parent
fbd8348597
commit
368cb66bf4
@ -7,15 +7,15 @@ import {
|
||||
Pencil,
|
||||
Phone,
|
||||
Receipt,
|
||||
Trash2,
|
||||
User,
|
||||
} from '@lucide/vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { toast } from 'vue-sonner';
|
||||
import BackButton from '@/components/button/BackButton.vue';
|
||||
import { RowDeleteAction, RowDetailAction, RowEditAction, RowStatusAction } from '@/components/button';
|
||||
import ConfirmDialog from '@/components/ConfirmDialog.vue';
|
||||
import OrderPrintButton from '@/components/order/OrderPrintButton.vue';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import {
|
||||
@ -187,37 +187,9 @@ const feeEntries = computed(() => {
|
||||
<h2 class="text-2xl font-bold tracking-tight">
|
||||
Detail Pesanan
|
||||
</h2>
|
||||
<p class="text-muted-foreground text-sm">
|
||||
{{ order.order_number }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex shrink-0 items-center gap-2 self-start sm:self-center">
|
||||
<OrderPrintButton :order="order as any" />
|
||||
|
||||
<template v-for="action in order.available_actions" :key="action.status">
|
||||
<Button v-if="canPerformAction(action)" size="sm"
|
||||
:variant="action.destructive ? 'outline' : 'default'"
|
||||
:class="action.destructive ? 'text-destructive hover:text-destructive' : ''"
|
||||
@click="openStatusConfirm(action)">
|
||||
<component :is="orderStatusActionIcon(action.status)" class="size-3.5" />
|
||||
{{ action.label }}
|
||||
</Button>
|
||||
</template>
|
||||
|
||||
<Button v-if="canEdit" variant="outline" size="sm" as-child>
|
||||
<Link :href="edit.url(props.order.id)">
|
||||
<Pencil class="size-3.5" />
|
||||
Ubah
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
<Button v-if="canDelete" variant="outline" size="sm" class="text-destructive hover:text-destructive"
|
||||
@click="deleteConfirmOpen = true">
|
||||
<Trash2 class="size-3.5" />
|
||||
Hapus
|
||||
</Button>
|
||||
|
||||
<BackButton :href="index.url()" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user