import React from 'react'; import PropTypes from 'prop-types'; import Login from './Login'; import Dashboard from './Dashboard'; import { _ } from 'webodm/classes/gettext'; import Trans from 'webodm/components/Trans'; export default class LightningPanel extends React.Component { static defaultProps = { apiKey: "", }; static propTypes = { apiKey: PropTypes.string } constructor(props){ super(props); this.state = { apiKey: props.apiKey } } handleLogin = (apiKey) => { this.setState({ apiKey }); } handleLogout = () => { this.setState({ apiKey: ""}); } render(){ const { apiKey } = this.state; return (