fix(admin-orders): make PDF download/view always available by generating PDF dynamically on the fly if missing
All checks were successful
Staging Build / build (push) Successful in 3m33s
All checks were successful
Staging Build / build (push) Successful in 3m33s
This commit is contained in:
@@ -223,22 +223,16 @@ export function OrdersTable({ initialOrders }: OrdersTableProps) {
|
||||
Bearbeiten
|
||||
</a>
|
||||
</Button>
|
||||
{order.pdf_url ? (
|
||||
<>
|
||||
<Button variant="outline" size="sm" asChild className="h-8 border-white/10 hover:bg-primary/20 text-xs">
|
||||
<a href={resolveSupabaseUrl(order.pdf_url)} target="_blank" rel="noopener noreferrer">
|
||||
<ExternalLink className="w-3.5 h-3.5 mr-1" /> PDF
|
||||
</a>
|
||||
</Button>
|
||||
<Button variant="secondary" size="sm" asChild className="h-8 text-xs">
|
||||
<a href={`/api/admin/orders/${order.id}/download`}>
|
||||
<Download className="w-3.5 h-3.5" />
|
||||
</a>
|
||||
</Button>
|
||||
</>
|
||||
) : (
|
||||
<span className="text-xs text-slate-500 italic self-center px-2">Keine Bestätigung</span>
|
||||
)}
|
||||
<Button variant="outline" size="sm" asChild className="h-8 border-white/10 hover:bg-primary/20 text-xs">
|
||||
<a href={`/api/admin/orders/${order.id}/download?inline=true`} target="_blank" rel="noopener noreferrer">
|
||||
<ExternalLink className="w-3.5 h-3.5 mr-1" /> PDF
|
||||
</a>
|
||||
</Button>
|
||||
<Button variant="secondary" size="sm" asChild className="h-8 text-xs">
|
||||
<a href={`/api/admin/orders/${order.id}/download`}>
|
||||
<Download className="w-3.5 h-3.5" />
|
||||
</a>
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
Reference in New Issue
Block a user