From 7ae3f815609150565f933205eff009fb16eda10f Mon Sep 17 00:00:00 2001 From: FajarFE <105129023+FajarFE@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:33:06 +0700 Subject: [PATCH] fixed:iframe,dynamic import and; improvement:created jsonDataDirectory script --- app/(components)/[componentName]/page.tsx | 65 +++++++++++----------- components/Iframe/index.tsx | 45 ++++++++++++++++ components/highlighter/highlighter.tsx | 66 ++++------------------- components/sections/list-components.tsx | 8 ++- constant/jsonDataDirectory.tsx | 52 ++++++++++++++++++ next.config.js | 4 +- package-lock.json | 21 +++++++- package.json | 4 +- tailwind.config.ts | 1 + utils/getComponentCode.tsx | 2 +- utils/getDirectoryComponents.ts | 58 ++++++++++++++++++++ 11 files changed, 233 insertions(+), 93 deletions(-) create mode 100644 components/Iframe/index.tsx create mode 100644 constant/jsonDataDirectory.tsx create mode 100644 utils/getDirectoryComponents.ts diff --git a/app/(components)/[componentName]/page.tsx b/app/(components)/[componentName]/page.tsx index ffc8c35..e517c0e 100644 --- a/app/(components)/[componentName]/page.tsx +++ b/app/(components)/[componentName]/page.tsx @@ -1,11 +1,14 @@ "use client"; -import React from "react"; +import React, { useEffect } from "react"; import components from "@/constant/components"; import ListComponents from "@/components/sections/list-components"; import { notFound } from "next/navigation"; import Link from "next/link"; +import jsonDataDirectory from "@/constant/jsonDataDirectory"; +import ReactDOMServer from "react-dom/server"; import { getComponentCode } from "@/utils/getComponentCode"; +import dynamic from "next/dynamic"; const Components = ({ params }: { params: { componentName: string } }) => { const filteredComponents = components.filter((component) => @@ -18,36 +21,36 @@ const Components = ({ params }: { params: { componentName: string } }) => { return notFound(); } - return ( -
- Maybe you meant{" "} - - {params.componentName} - -
- )} --{`${code}`}
+ {/*{`${code}`}
*/}