|
| 1 | +import { useNavigate } from 'react-router-dom'; |
| 2 | +import styled from '@emotion/styled'; |
| 3 | + |
1 | 4 | import { SettingsHeaderContainer } from '@/settings/components/SettingsHeaderContainer';
|
2 | 5 | import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
3 |
| -import { IconSettings } from '@/ui/display/icon'; |
| 6 | +import { SettingsApiKeysTable } from '@/settings/developers/components/SettingsApiKeysTable'; |
| 7 | +import { SettingsReadDocumentationButton } from '@/settings/developers/components/SettingsReadDocumentationButton'; |
| 8 | +import { SettingsWebhooksTable } from '@/settings/developers/components/SettingsWebhooksTable'; |
| 9 | +import { IconPlus, IconSettings } from '@/ui/display/icon'; |
| 10 | +import { H2Title } from '@/ui/display/typography/components/H2Title'; |
| 11 | +import { Button } from '@/ui/input/button/components/Button'; |
4 | 12 | import { SubMenuTopBarContainer } from '@/ui/layout/page/SubMenuTopBarContainer';
|
| 13 | +import { Section } from '@/ui/layout/section/components/Section'; |
5 | 14 | import { Breadcrumb } from '@/ui/navigation/bread-crumb/components/Breadcrumb';
|
6 |
| -import { SettingsDevelopersApiKeys } from '~/pages/settings/developers/api-keys/SettingsDevelopersApiKeys'; |
7 |
| -import { SettingsDevelopersWebhooks } from '~/pages/settings/developers/webhooks/SettingsDevelopersWebhooks'; |
8 | 15 |
|
9 |
| -import { ReadDocumentationButton } from './components/ReadDocumentationButton'; |
| 16 | +const StyledButtonContainer = styled.div` |
| 17 | + display: flex; |
| 18 | + justify-content: flex-end; |
| 19 | + padding-top: ${({ theme }) => theme.spacing(2)}; |
| 20 | +`; |
10 | 21 |
|
11 | 22 | export const SettingsDevelopers = () => {
|
| 23 | + const navigate = useNavigate(); |
| 24 | + |
12 | 25 | return (
|
13 | 26 | <SubMenuTopBarContainer Icon={IconSettings} title="Settings">
|
14 | 27 | <SettingsPageContainer>
|
15 | 28 | <SettingsHeaderContainer>
|
16 | 29 | <Breadcrumb links={[{ children: 'Developers' }]} />
|
17 |
| - <ReadDocumentationButton /> |
| 30 | + <SettingsReadDocumentationButton /> |
18 | 31 | </SettingsHeaderContainer>
|
19 |
| - <SettingsDevelopersApiKeys /> |
20 |
| - <SettingsDevelopersWebhooks /> |
| 32 | + <Section> |
| 33 | + <H2Title |
| 34 | + title="API keys" |
| 35 | + description="Active APIs keys created by you or your team." |
| 36 | + /> |
| 37 | + <SettingsApiKeysTable /> |
| 38 | + <StyledButtonContainer> |
| 39 | + <Button |
| 40 | + Icon={IconPlus} |
| 41 | + title="Create API key" |
| 42 | + size="small" |
| 43 | + variant="secondary" |
| 44 | + onClick={() => { |
| 45 | + navigate('/settings/developers/api-keys/new'); |
| 46 | + }} |
| 47 | + /> |
| 48 | + </StyledButtonContainer> |
| 49 | + </Section> |
| 50 | + <Section> |
| 51 | + <H2Title |
| 52 | + title="Webhooks" |
| 53 | + description="Establish Webhook endpoints for notifications on asynchronous events." |
| 54 | + /> |
| 55 | + <SettingsWebhooksTable /> |
| 56 | + <StyledButtonContainer> |
| 57 | + <Button |
| 58 | + Icon={IconPlus} |
| 59 | + title="Create Webhook" |
| 60 | + size="small" |
| 61 | + variant="secondary" |
| 62 | + onClick={() => { |
| 63 | + navigate('/settings/developers/webhooks/new'); |
| 64 | + }} |
| 65 | + /> |
| 66 | + </StyledButtonContainer> |
| 67 | + </Section> |
21 | 68 | </SettingsPageContainer>
|
22 | 69 | </SubMenuTopBarContainer>
|
23 | 70 | );
|
|
0 commit comments