This commit is contained in:
Sabda Yagra 2025-11-25 13:57:05 +07:00
commit 0a262d3c3e
1 changed files with 13 additions and 0 deletions

View File

@ -824,6 +824,19 @@ export default function FormTaskDetail() {
// getColumn("judul")?.setFilterValue(e.target.value); // Set filter tabel
};
const getViewerUrl = (url: string) => {
const ext = url.split(".").pop()?.toLowerCase();
if (ext === "pdf") {
return url; // langsung tampilkan PDF
}
// doc / docx → pakai Google Viewer, lebih compatible
return `https://docs.google.com/viewer?url=${encodeURIComponent(
url
)}&embedded=true`;
};
return (
<Card>
{detail !== undefined ? (