UNPKG

@jbrowse/plugin-authentication

Version:

JBrowse 2 Authentication

21 lines (20 loc) 1.44 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState } from 'react'; import { Dialog } from '@jbrowse/core/ui'; import { Button, DialogActions, DialogContent, TextField } from '@mui/material'; export const ExternalTokenEntryForm = ({ internetAccountId, handleClose, }) => { const [token, setToken] = useState(''); return (_jsxs(Dialog, { open: true, maxWidth: "xl", "data-testid": "externalToken-form", onClose: () => { handleClose(); }, title: `Enter token for ${internetAccountId}`, children: [_jsx(DialogContent, { style: { display: 'flex', flexDirection: 'column' }, children: _jsx(TextField, { required: true, label: "Enter Token", variant: "outlined", onChange: event => { setToken(event.target.value); }, margin: "dense", slotProps: { htmlInput: { 'data-testid': 'entry-externalToken' }, } }) }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "primary", type: "submit", disabled: !token, onClick: () => { if (token) { handleClose(token); } }, children: "Add" }), _jsx(Button, { variant: "contained", color: "secondary", onClick: () => { handleClose(); }, children: "Cancel" })] })] })); };