diff --git a/.gitignore b/.gitignore index d1595af..0a6f608 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ yarn-error.log* # vercel .vercel + +.idea/ diff --git a/apps/website_dashboard/components/pages/dashboard/collections/collection_subroute_pages/query/hit_component.tsx b/apps/website_dashboard/components/pages/dashboard/collections/collection_subroute_pages/query/hit_component.tsx index 74803fa..da6f512 100644 --- a/apps/website_dashboard/components/pages/dashboard/collections/collection_subroute_pages/query/hit_component.tsx +++ b/apps/website_dashboard/components/pages/dashboard/collections/collection_subroute_pages/query/hit_component.tsx @@ -1,37 +1,42 @@ import React from "react"; interface HitComponentProps { - hit: any; - keys: Record<"inSchema" | "notInSchema", string[]>; + hit: any; + keys: Record<"inSchema" | "notInSchema", string[]>; +} +const showData = (data: any) => { + if(typeof data === "object"){ + return JSON.stringify(data) + } + return data } - const HitComponent = ({ hit, keys }: HitComponentProps) => { - return ( -
-
- {keys.notInSchema.map((field, index) => { - return ( -
-

{field}

-

:

-

{hit[field]}

+ return ( +
+
+ {keys.notInSchema.map((field, index) => { + return ( +
+

{field}

+

:

+

{showData(hit[field])}

+
+ ); + })}
- ); - })} -
-
- {keys.inSchema.map((field, index) => { - return ( -
-

{field}

-

:

-

{hit[field]}

+
+ {keys.inSchema.map((field, index) => { + return ( +
+

{field}

+

:

+

{showData(hit[field])}

+
+ ); + })}
- ); - })} -
-
- ); +
+ ); }; export default HitComponent;