UNPKG

@jbrowse/plugin-authentication

Version:

JBrowse 2 Authentication

25 lines (24 loc) 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExternalTokenEntryForm = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const ui_1 = require("@jbrowse/core/ui"); const material_1 = require("@mui/material"); const ExternalTokenEntryForm = ({ internetAccountId, handleClose, }) => { const [token, setToken] = (0, react_1.useState)(''); return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, maxWidth: "xl", "data-testid": "externalToken-form", onClose: () => { handleClose(); }, title: `Enter token for ${internetAccountId}`, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { style: { display: 'flex', flexDirection: 'column' }, children: (0, jsx_runtime_1.jsx)(material_1.TextField, { required: true, label: "Enter Token", variant: "outlined", onChange: event => { setToken(event.target.value); }, margin: "dense", slotProps: { htmlInput: { 'data-testid': 'entry-externalToken' }, } }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", disabled: !token, onClick: () => { if (token) { handleClose(token); } }, children: "Add" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => { handleClose(); }, children: "Cancel" })] })] })); }; exports.ExternalTokenEntryForm = ExternalTokenEntryForm;