diff --git a/packages/pl-fe/src/components/ui/widget.tsx b/packages/pl-fe/src/components/ui/widget.tsx index d2b18971c..44b2d7306 100644 --- a/packages/pl-fe/src/components/ui/widget.tsx +++ b/packages/pl-fe/src/components/ui/widget.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import React from 'react'; +import React, { useMemo } from 'react'; import IconButton from '@/components/ui/icon-button'; @@ -26,24 +26,28 @@ const Widget: React.FC = ({ actionTitle, action, className, -}): JSX.Element => ( -
- {(title ?? action ?? onActionClick) && ( -
- {title &&

{title}

} - {action ?? - (onActionClick && ( - - ))} -
- )} -
{children}
-
-); +}): JSX.Element => { + const widgetId = useMemo(() => crypto.randomUUID(), []); + + return ( +
+ {(title ?? action ?? onActionClick) && ( +
+ {title &&

{title}

} + {action ?? + (onActionClick && ( + + ))} +
+ )} +
{children}
+
+ ); +}; export { Widget as default };