import { Widget } from '@/hooks/Mapper/components/mapInterface/components'; import { useMapRootState } from '@/hooks/Mapper/mapRootProvider'; import { LayoutEventBlocker, SystemView, WdImgButton } from '@/hooks/Mapper/components/ui-kit'; import { SystemInfoContent } from './SystemInfoContent'; import { PrimeIcons } from 'primereact/api'; import { useState, useCallback } from 'react'; import { SystemSettingsDialog } from '@/hooks/Mapper/components/mapInterface/components/SystemSettingsDialog/SystemSettingsDialog.tsx'; import { getSystemById } from '@/hooks/Mapper/helpers'; import { ANOIK_ICON, DOTLAN_ICON, ZKB_ICON } from '@/hooks/Mapper/icons'; export const SystemInfo = () => { const [visible, setVisible] = useState(false); const { data: { selectedSystems, systems }, } = useMapRootState(); const [systemId] = selectedSystems; const sys = getSystemById(systems, systemId)!; const { solar_system_name: solarSystemName } = sys?.system_static_info || {}; 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={{ content: 'Edit system name and description' }} />
) } > {isNotSelectedSystem ? (
System is not selected
) : ( setVisible(true)} /> )} {visible && }
); };