From 90710579ba1c12060877f6ec2d26103f9c31058d Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 23 Oct 2023 17:11:33 +0700
Subject: Refactor and migrate register page

---
 src-migrate/modules/page-content/index.tsx | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 src-migrate/modules/page-content/index.tsx

(limited to 'src-migrate/modules/page-content/index.tsx')

diff --git a/src-migrate/modules/page-content/index.tsx b/src-migrate/modules/page-content/index.tsx
new file mode 100644
index 00000000..cbd58633
--- /dev/null
+++ b/src-migrate/modules/page-content/index.tsx
@@ -0,0 +1,22 @@
+import { useQuery } from "react-query"
+import PageContentSkeleton from "~/common/components/skeleton/PageContentSkeleton"
+import { PageContentProps } from "~/common/types/pageContent"
+import { getPageContent } from "~/services/pageContent"
+
+type Props = {
+  path: string
+}
+
+const PageContent = ({ path }: Props) => {
+  const { data, isLoading } = useQuery<PageContentProps>(`page-content:${path}`, async () => await getPageContent({ path }))
+
+  if (isLoading) {
+    return <PageContentSkeleton />
+  }
+
+  return (
+    <div dangerouslySetInnerHTML={{ __html: data?.content || '' }}></div>
+  )
+}
+
+export default PageContent
\ No newline at end of file
-- 
cgit v1.2.3

