2021-10-03 23:24:23 +00:00
|
|
|
import React from 'react';
|
|
|
|
import tw from 'twin.macro';
|
2021-10-03 23:10:06 +00:00
|
|
|
import { useFormikContext } from 'formik';
|
|
|
|
import AdminBox from '@/components/admin/AdminBox';
|
|
|
|
import { faCogs } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import Field from '@/components/elements/Field';
|
|
|
|
import OwnerSelect from '@/components/admin/servers/OwnerSelect';
|
2021-10-09 19:02:32 +00:00
|
|
|
import { useServerFromRoute } from '@/api/admin/server';
|
2021-10-03 23:10:06 +00:00
|
|
|
|
2021-10-03 23:24:23 +00:00
|
|
|
export default () => {
|
2021-10-09 19:02:32 +00:00
|
|
|
const { data: server } = useServerFromRoute();
|
2021-10-03 23:10:06 +00:00
|
|
|
const { isSubmitting } = useFormikContext();
|
|
|
|
|
2021-10-03 23:24:23 +00:00
|
|
|
if (!server) return null;
|
2021-10-03 23:10:06 +00:00
|
|
|
|
2021-10-03 23:24:23 +00:00
|
|
|
return (
|
|
|
|
<AdminBox icon={faCogs} title={'Settings'} isLoading={isSubmitting}>
|
|
|
|
<div css={tw`grid grid-cols-1 xl:grid-cols-2 gap-4 lg:gap-6`}>
|
|
|
|
<Field id={'name'} name={'name'} label={'Server Name'} type={'text'}/>
|
|
|
|
<Field id={'externalId'} name={'externalId'} label={'External Identifier'} type={'text'}/>
|
2021-10-09 19:02:32 +00:00
|
|
|
<OwnerSelect selected={server.relationships.user}/>
|
2021-10-03 23:10:06 +00:00
|
|
|
</div>
|
|
|
|
</AdminBox>
|
|
|
|
);
|
|
|
|
};
|