/* * Copyright (C) 2022 Red Hat, Inc. * SPDX-License-Identifier: LGPL-2.1-or-later */ import cockpit from "cockpit"; import React, { useContext, useEffect, useState } from "react"; import { Content, ContentVariants } from "@patternfly/react-core/dist/esm/components/Content/index.js"; import { Label } from "@patternfly/react-core/dist/esm/components/Label/index.js"; import { PageSection } from "@patternfly/react-core/dist/esm/components/Page/index.js"; import { Popover, PopoverPosition } from "@patternfly/react-core/dist/esm/components/Popover/index.js"; import { Flex } from "@patternfly/react-core/dist/esm/layouts/Flex/index.js"; import { InfoCircleIcon } from "@patternfly/react-icons/dist/esm/icons/info-circle-icon"; import { getIsFinal } from "../apis/runtime.js"; import { NetworkContext } from "../contexts/Common.jsx"; import { HeaderKebab } from "./HeaderKebab.jsx"; import "./AnacondaHeader.scss"; const _ = cockpit.gettext; const N_ = cockpit.noop; export const AnacondaHeader = ({ dispatch, onCritFail, reportLinkURL, setShowStorage, showStorage, title }) => { const [beta, setBeta] = useState(); const network = useContext(NetworkContext); const isConnected = network.connected; useEffect(() => { getIsFinal().then( isFinal => setBeta(!isFinal), onCritFail({ context: N_("Reading installer version information failed.") }) ); }, [onCritFail]); return (
{title} {beta && } ); }; const Beta = () => { const prerelease = _("Pre-release"); return ( {_("Notice: This is pre-released software that is intended for development and testing purposes only. Do NOT use this software for any critical work or for production environments.")} {_("By continuing to use this software, you understand and accept the risks associated with pre-released software, that you intend to use this for testing and development purposes only and are willing to report any bugs or issues in order to enhance this work.")} {_("If you do not understand or accept the risks, then please exit this program.")} } > ); };