import PropTypes from 'prop-types' import { useState } from 'react' import { Button, Flex, Typography, Card, Dropdown, Modal, Table } from 'antd' import TimeDisplay from '../../common/TimeDisplay' import FarmControlAppIcon from '../../../Logos/FarmControlAppIcon' import EyeIcon from '../../../Icons/EyeIcon' const { Text, Title } = Typography const NewAppUpdate = ({ update, onCancel, onUpdate }) => { const artifacts = Array.isArray(update?.artifacts) ? update.artifacts : [] const primaryArtifact = artifacts.find((artifact) => artifact.url) const [changesMenuOpen, setChangesMenuOpen] = useState(false) const columns = [ { title: 'Date', dataIndex: 'date', key: 'date', width: 290, render: (text, record) => { return } }, { title: 'Author', dataIndex: 'author', key: 'author', width: 180 }, { title: 'Message', dataIndex: 'message', key: 'message', width: 500 } ] const actionsMenu = { items: [ { label: 'View Changes', key: 'viewChanges', icon: } ], onClick: ({ key }) => { if (key === 'viewChanges') { setChangesMenuOpen(true) } } } return ( <> A new Farm Control update is available. Would you like to update now? {'Farm Control UI'} Version:{' '} {update?.version ? `v${update.version}` : 'Unknown'} Build Number:{' '} {update?.buildNumber ? `b${update.buildNumber}` : 'Unknown'} Branch: {update?.branch || 'Unknown'} Built at: setChangesMenuOpen(false)} footer={null} title='View Changes' width={1200} >
) } NewAppUpdate.propTypes = { update: PropTypes.object, onCancel: PropTypes.func.isRequired, onUpdate: PropTypes.func.isRequired } export default NewAppUpdate