Fix MinIO DPP upload linking to frontend
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"use client"
|
||||
"use client"
|
||||
|
||||
import { fetchWithAuth } from "@/lib/apiClient";
|
||||
import { Button } from "@/components/ui/button"
|
||||
@@ -197,8 +197,12 @@ export default function AIDailyPracticePage() {
|
||||
<div className="flex flex-col sm:flex-row gap-2 shrink-0 md:self-center">
|
||||
{isUpcoming ? (
|
||||
<Button disabled variant="outline" size="sm" className="font-bold">Starts Soon</Button>
|
||||
) : isExpired && !isAttempted ? (
|
||||
) : isExpired && !isAttempted && !dpp.pdf_url ? (
|
||||
<Button disabled variant="outline" size="sm" className="font-bold bg-secondary/50">Expired</Button>
|
||||
) : dpp.pdf_url ? (
|
||||
<Button onClick={() => setSelectedPdfDpp(dpp)} variant="secondary" size="sm" className="rounded-xl bg-[var(--cyan-ai)] text-black hover:bg-[var(--cyan-ai-80)] font-extrabold gap-2 text-xs shadow-[0_0_12px_rgba(12,96,96,0.2)]">
|
||||
<FileText size={14} className="text-black" /> View PDF
|
||||
</Button>
|
||||
) : isAttempted ? (
|
||||
<>
|
||||
<Link href={`/cbt/${dpp.id}/result`}>
|
||||
@@ -298,7 +302,7 @@ export default function AIDailyPracticePage() {
|
||||
style={{minHeight: isFullScreen ? 'calc(100vh - 120px)' : '75vh'}}
|
||||
>
|
||||
<embed
|
||||
src={getPdfUrl(selectedPdfDpp.title)}
|
||||
src={selectedPdfDpp.pdf_url || getPdfUrl(selectedPdfDpp.title)}
|
||||
type="application/pdf"
|
||||
className="w-full h-full"
|
||||
style={{height: isFullScreen ? 'calc(100vh - 120px)' : '75vh'}}
|
||||
|
||||
Reference in New Issue
Block a user