fix magazine
This commit is contained in:
parent
34311f2fc4
commit
d110f85e30
|
|
@ -70,7 +70,11 @@ export default function ENewsPolri() {
|
|||
<Card isFooterBlurred radius="lg" className="border-none">
|
||||
<img
|
||||
alt="thumbnail"
|
||||
src={newsItem?.thumbnailUrl ? "" : "/no-image.jpg"}
|
||||
src={
|
||||
newsItem?.thumbnailUrl
|
||||
? newsItem?.thumbnailUrl
|
||||
: "/no-image.jpg"
|
||||
}
|
||||
className="!h-[25vh] object-cover rounded-none"
|
||||
/>
|
||||
<CardFooter className="before:bg-white/10 border-white/20 border-1 overflow-hidden py-1 md:absolute bottom-1 shadow-small z-10">
|
||||
|
|
@ -81,7 +85,6 @@ export default function ENewsPolri() {
|
|||
</p>
|
||||
</Link>
|
||||
<div className="flex flex-row gap-1">
|
||||
{" "}
|
||||
<p className="py-[2px] text-left text-xs">
|
||||
{convertDateFormat(newsItem.createdAt)} WIB
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
"use client";
|
||||
import { ChevronRightIcon } from "@/components/icons";
|
||||
import { close, loading } from "@/config/swal";
|
||||
import { getMagazineById } from "@/service/magazine";
|
||||
import {
|
||||
convertDateFormat,
|
||||
|
|
@ -24,16 +25,18 @@ export default function EMagazineDetail() {
|
|||
}, [id]);
|
||||
|
||||
const initFetch = async () => {
|
||||
loading();
|
||||
const res = await getMagazineById(String(id));
|
||||
const data = res?.data?.data;
|
||||
setDetailData(data);
|
||||
setDetailFiles(data?.files);
|
||||
close();
|
||||
};
|
||||
|
||||
const doDownload = async (fileName: string, title: string): Promise<void> => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`https://38.47.180.165:8802/magazine-files/viewer/${fileName}`
|
||||
`https://kontenhumas.com/magazine-files/viewer/${fileName}`
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
|
|
@ -80,11 +83,7 @@ export default function EMagazineDetail() {
|
|||
className="h-[380px] rounded-md py-1"
|
||||
/> */}
|
||||
<img
|
||||
src={`https://kontenhumas.com/magazines/thumbnail/viewer/${
|
||||
detailData?.thumbnailPath.split("/")[
|
||||
detailData?.thumbnailPath.split("/").length - 1
|
||||
]
|
||||
}`}
|
||||
src={detailData?.thumbnailUrl}
|
||||
alt="emagazine"
|
||||
className="h-[380px] rounded-md py-1"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue