From 349f313c867da066a8f8eab21c9c634ebaa7fdd3 Mon Sep 17 00:00:00 2001 From: Jalinson Diaz Date: Thu, 14 Nov 2024 13:09:07 -0300 Subject: [PATCH] Update contentlets.js --- .../src/components/shared/contentlets.js | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/examples/nextjs/src/components/shared/contentlets.js b/examples/nextjs/src/components/shared/contentlets.js index 1ea66565e9fa..55e057fc6871 100644 --- a/examples/nextjs/src/components/shared/contentlets.js +++ b/examples/nextjs/src/components/shared/contentlets.js @@ -1,7 +1,7 @@ 'use client'; -import React from 'react'; +import { useMemo } from 'react'; import Image from 'next/image'; -import { editContentlet } from '@dotcms/client'; +import { editContentlet, isInsideEditor } from '@dotcms/client'; const dateFormatOptions = { year: 'numeric', @@ -10,27 +10,31 @@ const dateFormatOptions = { }; function Contentlets({ contentlets }) { + const insideEditor = useMemo(isInsideEditor, []); + return (