MCPcopy Create free account
hub / github.com/gotify/server / AddClientDialog

Function AddClientDialog

ui/src/client/AddClientDialog.tsx:15–56  ·  view source on GitHub ↗
({fClose, fOnSubmit}: IProps)

Source from the content-addressed store, hash-verified

13}
14
15const AddClientDialog = ({fClose, fOnSubmit}: IProps) => {
16 const [name, setName] = useState('');
17
18 const submitEnabled = name.length !== 0;
19 const submitAndClose = async () => {
20 await fOnSubmit(name);
21 fClose();
22 };
23
24 return (
25 <Dialog open={true} onClose={fClose} aria-labelledby="form-dialog-title" id="client-dialog">
26 <DialogTitle id="form-dialog-title">Create a client</DialogTitle>
27 <DialogContent>
28 <TextField
29 autoFocus
30 margin="dense"
31 className="name"
32 label="Name *"
33 type="email"
34 value={name}
35 onChange={(e) => setName(e.target.value)}
36 fullWidth
37 />
38 </DialogContent>
39 <DialogActions>
40 <Button onClick={fClose}>Cancel</Button>
41 <Tooltip placement={'bottom-start'} title={submitEnabled ? '' : 'name is required'}>
42 <div>
43 <Button
44 className="create"
45 disabled={!submitEnabled}
46 onClick={submitAndClose}
47 color="primary"
48 variant="contained">
49 Create
50 </Button>
51 </div>
52 </Tooltip>
53 </DialogActions>
54 </Dialog>
55 );
56};
57
58export default AddClientDialog;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…