-
Notifications
You must be signed in to change notification settings - Fork 67
/
Rest.tsx
44 lines (38 loc) 路 1.27 KB
/
Rest.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {Form, Tabs} from 'antd';
import {DEFAULT_HEADERS} from 'constants/Test.constants';
import {Body} from 'components/Inputs';
import useQueryTabs from 'hooks/useQueryTabs';
import {Auth, SSL, KeyValueList, SkipTraceCollection} from 'components/Fields';
import * as S from './Rest.styled';
const Rest = () => {
const [activeKey, setActiveKey] = useQueryTabs('auth', 'triggerTab');
return (
<Tabs defaultActiveKey={activeKey} activeKey={activeKey} onChange={setActiveKey}>
<Tabs.TabPane forceRender tab="Auth" key="auth">
<Auth />
</Tabs.TabPane>
<Tabs.TabPane forceRender tab="Body" key="body">
<Form.Item name="body" noStyle>
<Body />
</Form.Item>
</Tabs.TabPane>
<Tabs.TabPane forceRender tab="Headers" key="headers">
<KeyValueList
name="headers"
label=""
addButtonLabel="Add Header"
keyPlaceholder="Header"
valuePlaceholder="Value"
initialValue={DEFAULT_HEADERS}
/>
</Tabs.TabPane>
<Tabs.TabPane forceRender tab="Settings" key="settings">
<S.SettingsContainer>
<SSL formID="rest" />
<SkipTraceCollection />
</S.SettingsContainer>
</Tabs.TabPane>
</Tabs>
);
};
export default Rest;