diff --git a/src/components/ModIIDtools.jsx b/src/components/ModIIDtools.jsx new file mode 100644 index 0000000..835f969 --- /dev/null +++ b/src/components/ModIIDtools.jsx @@ -0,0 +1,96 @@ +/* + * Admintools + */ + +import React, { useState } from 'react'; +import { t } from 'ttag'; + +async function submitIIDAction( + action, + iid, + callback, +) { + const data = new FormData(); + data.append('iidaction', action); + data.append('iid', iid); + const resp = await fetch('./api/modtools', { + credentials: 'include', + method: 'POST', + body: data, + }); + callback(await resp.text()); +} + +function ModIIDtools() { + const [iIDAction, selectIIDAction] = useState('ban'); + const [iid, selectIid] = useState(''); + const [resp, setResp] = useState(null); + const [submitting, setSubmitting] = useState(false); + + return ( +
+

{t`IID Actions`}

+ +

+ {' IID: '} + { + const newIid = evt.target.value.trim(); + selectIid(newIid); + }} + /> +

+ +