fix: resolve Supabase storage pdf URLs on client and server
Some checks failed
Staging Build / build (push) Has been cancelled
Some checks failed
Staging Build / build (push) Has been cancelled
This commit is contained in:
@@ -6,6 +6,7 @@ import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent } from '@/components/ui/card'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import type { Order } from '@/lib/types'
|
||||
import { resolveSupabaseUrl } from '@/lib/utils'
|
||||
|
||||
const statusLabel: Record<string, string> = {
|
||||
pending: 'Eingegangen',
|
||||
@@ -142,12 +143,12 @@ export default async function MyOrdersPage() {
|
||||
{o.pdf_url && (
|
||||
<>
|
||||
<Button variant="ghost" size="sm" asChild className="text-xs text-slate-400 hover:text-white">
|
||||
<a href={o.pdf_url} target="_blank" rel="noopener noreferrer">
|
||||
<a href={resolveSupabaseUrl(o.pdf_url)} target="_blank" rel="noopener noreferrer">
|
||||
<ExternalLink className="w-3 h-3 mr-1" /> Anfrage ansehen
|
||||
</a>
|
||||
</Button>
|
||||
<Button variant="ghost" size="sm" asChild className="text-xs text-slate-400 hover:text-white">
|
||||
<a href={o.pdf_url} download>
|
||||
<a href={resolveSupabaseUrl(o.pdf_url)} download>
|
||||
<Download className="w-3 h-3 mr-1" /> PDF
|
||||
</a>
|
||||
</Button>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Separator } from '@/components/ui/separator'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import type { Order } from '@/lib/types'
|
||||
import { resolveSupabaseUrl } from '@/lib/utils'
|
||||
|
||||
export default async function OrderSuccessPage({
|
||||
searchParams,
|
||||
@@ -150,12 +151,12 @@ export default async function OrderSuccessPage({
|
||||
{o.pdf_url && (
|
||||
<div className="flex gap-2 pt-2">
|
||||
<Button variant="outline" size="sm" asChild className="border-white/10 hover:bg-white/10">
|
||||
<a href={o.pdf_url} target="_blank" rel="noopener noreferrer">
|
||||
<a href={resolveSupabaseUrl(o.pdf_url)} target="_blank" rel="noopener noreferrer">
|
||||
<ExternalLink className="w-4 h-4 mr-2" /> Angebotsbestätigung ansehen
|
||||
</a>
|
||||
</Button>
|
||||
<Button variant="secondary" size="sm" asChild>
|
||||
<a href={o.pdf_url} download>
|
||||
<a href={resolveSupabaseUrl(o.pdf_url)} download>
|
||||
<Download className="w-4 h-4 mr-2" /> Herunterladen
|
||||
</a>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user