import { useState } from 'react'; import { Database, Hash, Server, Tag, Wrench } from 'lucide-react'; import { useSystemStatus } from '@/react/portainer/system/useSystemStatus'; import { useSystemVersion } from '@/react/portainer/system/useSystemVersion'; import { Modal } from '@@/modals'; import { Button } from '@@/buttons'; import styles from './Footer.module.css'; export function BuildInfoModalButton() { const [isBuildInfoVisible, setIsBuildInfoVisible] = useState(false); const statusQuery = useSystemStatus(); if (!statusQuery.data) { return null; } const { Version } = statusQuery.data; return ( <> setIsBuildInfoVisible(true)} > {Version} {isBuildInfoVisible && ( setIsBuildInfoVisible(false)} /> )} > ); } function BuildInfoModal({ closeModal }: { closeModal: () => void }) { const versionQuery = useSystemVersion(); const statusQuery = useSystemStatus(); if (!statusQuery.data || !versionQuery.data) { return null; } const { Edition } = statusQuery.data; const { ServerVersion, DatabaseVersion, Build } = versionQuery.data; return ( Server Version: {ServerVersion} Database Version: {DatabaseVersion} CI Build Number: {Build.BuildNumber} Image Tag: {Build.ImageTag} Compilation tools: Nodejs v{Build.NodejsVersion} Yarn v{Build.YarnVersion} Webpack v{Build.WebpackVersion} Go v{Build.GoVersion} Ok ); }