import { Widget } from '@/hooks/Mapper/components/mapInterface/components'; import { Comments } from '@/hooks/Mapper/components/mapInterface/components/Comments'; import { InfoDrawer, SystemView, TooltipPosition, WdImgButton } from '@/hooks/Mapper/components/ui-kit'; import { useRef } from 'react'; import useMaxWidth from '@/hooks/Mapper/hooks/useMaxWidth.ts'; import { COMPACT_MAX_WIDTH } from '@/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/constants.ts'; import { useMapRootState } from '@/hooks/Mapper/mapRootProvider'; import clsx from 'clsx'; import { CommentsEditor } from '@/hooks/Mapper/components/mapInterface/components/CommentsEditor'; import { PrimeIcons } from 'primereact/api'; export const CommentsWidgetContent = () => { const { data: { selectedSystems }, } = useMapRootState(); const isNotSelectedSystem = selectedSystems.length !== 1; if (isNotSelectedSystem) { return (
System is not selected
); } return (
); }; export const CommentsWidget = () => { const containerRef = useRef(null); const isCompact = useMaxWidth(containerRef, COMPACT_MAX_WIDTH); const { data: { selectedSystems, isSubscriptionActive }, } = useMapRootState(); const [systemId] = selectedSystems; const isNotSelectedSystem = selectedSystems.length !== 1; return (
{!isCompact && (
Comments {isNotSelectedSystem ? '' : 'in'}
)} {!isNotSelectedSystem && }
How to add/delete comment?}> It is possible to use markdown formating.
Only users with tracking permission can add/delete comments.
Limitations}> Each comment length is limited to 500 characters.
No more than {isSubscriptionActive ? '500' : '30'} comments are allowed per system*.
* based on active map subscription.
), }} /> } >
); };