From 833488811b4164d7fbdce9bd70e171f06d62bf8d Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 20 Mar 2023 14:33:21 +0700
Subject: login and register

---
 src/lib/content/components/PageContent.jsx | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

(limited to 'src/lib/content/components/PageContent.jsx')

diff --git a/src/lib/content/components/PageContent.jsx b/src/lib/content/components/PageContent.jsx
index 4c17ab54..f7c2f467 100644
--- a/src/lib/content/components/PageContent.jsx
+++ b/src/lib/content/components/PageContent.jsx
@@ -5,15 +5,14 @@ import Spinner from '@/core/components/elements/Spinner/Spinner'
 const PageContent = ({ path }) => {
   const fetchContent = async () => await pageContentApi({ path })
   const content = useQuery(`content-${path}`, fetchContent)
-
-  if (content.data) {
+  
+  if (content.data?.id) {
     let parsedContent = content.data.content
     parsedContent = parsedContent.replaceAll(
       'src="/web/image',
       `src="${process.env.NEXT_PUBLIC_ODOO_HOST}/web/image`
     )
-    const contentClassNames = `
-      p-4 
+    const contentClassNames = ` 
       prose 
       prose-gray 
       prose-a:text-red_r-10 
@@ -26,12 +25,7 @@ const PageContent = ({ path }) => {
       prose-hr:my-3
     `
 
-    return (
-      <div
-        className={contentClassNames}
-        dangerouslySetInnerHTML={{ __html: parsedContent }}
-      />
-    )
+    return <div className={contentClassNames} dangerouslySetInnerHTML={{ __html: parsedContent }} />
   }
 
   if (content.isLoading) {
-- 
cgit v1.2.3

