diff --git a/components/form/broadcast/content-blast-form.tsx b/components/form/broadcast/content-blast-form.tsx index 087ccce9..5453ac62 100644 --- a/components/form/broadcast/content-blast-form.tsx +++ b/components/form/broadcast/content-blast-form.tsx @@ -50,7 +50,6 @@ const CustomEditor = dynamic( { ssr: false } ); - const animatedComponent = makeAnimated(); const FormSchema = z.object({ @@ -144,20 +143,22 @@ export default function ContentBlast(props: { type: string }) { async function initState() { const response = await detailMediaSummary(String(id)); const details = response?.data?.data; + let pageUrl = details?.pageUrl || ""; + if (process.env.NODE_ENV === "production") { + pageUrl = pageUrl.replace(/(\.com|\.id)(\/|$)/, "$1/in$2"); + } if (details != undefined) { form.setValue("thumbnail", details.smallThumbnailLink); let body = `

Berita hari ini !!!

${details?.pageUrl}

${ + }'>

${pageUrl}

${ details?.title }

${textEllipsis(details?.description, 150)}

`; form.setValue("title", `${details?.title}`); form.setValue( "url", - details?.pageUrl || "https://mediahub.polri.go.id/in" + details?.pageUrl || "https://mediahub.polri.go.id" ); if (type == "wa") { body = `${textEllipsis(details?.description, 150)}`; @@ -241,11 +242,14 @@ export default function ContentBlast(props: { type: string }) { render={({ field }) => ( Detail Perencanaan - {type === "wa" ? ( -