From 36601aba6017aeef16f89351eb487238402ab52e Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Tue, 24 Sep 2024 16:12:50 +0700 Subject: update Perapihan Tag --- src-migrate/modules/page-content/index.tsx | 61 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 30 deletions(-) (limited to 'src-migrate/modules/page-content') diff --git a/src-migrate/modules/page-content/index.tsx b/src-migrate/modules/page-content/index.tsx index 547b1957..af597641 100644 --- a/src-migrate/modules/page-content/index.tsx +++ b/src-migrate/modules/page-content/index.tsx @@ -1,44 +1,45 @@ -import { useMemo } from "react" -import { useQuery } from "react-query" -import { PageContentProps } from "~/types/pageContent" -import { getPageContent } from "~/services/pageContent" +import { useMemo } from 'react'; +import { useQuery } from 'react-query'; +import { PageContentProps } from '~/types/pageContent'; +import { getPageContent } from '~/services/pageContent'; type Props = { - path: string -} + path: string; +}; const PageContent = ({ path }: Props) => { - const { data, isLoading } = useQuery(`page-content:${path}`, async () => await getPageContent({ path })) + const { data, isLoading } = useQuery( + `page-content:${path}`, + async () => await getPageContent({ path }) + ); const parsedContent = useMemo(() => { - if (!data) return '' + if (!data) return ''; return data.content.replaceAll( 'src="/web/image', `src="${process.env.NEXT_PUBLIC_ODOO_API_HOST}/web/image` - ) - }, [data]) + ); + }, [data]); + console.log('parsedContent', parsedContent); + if (isLoading) return ; - if (isLoading) return - - return ( -
- ) -} + return
; +}; const PageContentSkeleton = () => ( -
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-) +); -export default PageContent \ No newline at end of file +export default PageContent; -- cgit v1.2.3