misc_pterodactyl-panel/resources/scripts/components/server/users/AddSubuserButton.tsx

20 lines
712 B
TypeScript
Raw Normal View History

import React, { useState } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUserPlus } from '@fortawesome/free-solid-svg-icons/faUserPlus';
import EditSubuserModal from '@/components/server/users/EditSubuserModal';
2020-07-04 23:26:07 +00:00
import Button from '@/components/elements/Button';
import tw from 'twin.macro';
export default () => {
const [ visible, setVisible ] = useState(false);
return (
<>
2020-07-04 23:26:07 +00:00
{visible && <EditSubuserModal appear visible onDismissed={() => setVisible(false)}/>}
<Button onClick={() => setVisible(true)}>
<FontAwesomeIcon icon={faUserPlus} css={tw`mr-1`}/> New User
</Button>
</>
);
};