import { Widget } from '@/hooks/Mapper/components/mapInterface/components'; import { useMapRootState } from '@/hooks/Mapper/mapRootProvider'; import { LayoutEventBlocker, SystemView, TooltipPosition, WdImgButton } from '@/hooks/Mapper/components/ui-kit'; import { SystemInfoContent } from './SystemInfoContent'; import { PrimeIcons } from 'primereact/api'; import { useCallback, useState } from 'react'; import { SystemSettingsDialog } from '@/hooks/Mapper/components/mapInterface/components/SystemSettingsDialog/SystemSettingsDialog.tsx'; import { ANOIK_ICON, DOTLAN_ICON, ZKB_ICON } from '@/hooks/Mapper/icons'; import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic'; export const SystemInfo = () => { const [visible, setVisible] = useState(false); const { data: { selectedSystems }, } = useMapRootState(); const [systemId] = selectedSystems; const systemStaticInfo = getSystemStaticInfo(systemId)!; const { solar_system_name: solarSystemName } = systemStaticInfo || {}; const isNotSelectedSystem = selectedSystems.length !== 1; const copySystemNameToClipboard = useCallback(async () => { try { await navigator.clipboard.writeText(solarSystemName); } catch (err) { console.error(err); } }, [solarSystemName]); return (
setVisible(true)} tooltip={{ position: TooltipPosition.top, content: 'Edit system name and description' }} />
) } > {isNotSelectedSystem ? (
System is not selected
) : ( setVisible(true)} /> )} {visible && }
); };