Files
astuto/app/javascript/components/SiteSettings/Webhooks/WebhookFormPage.tsx
Riccardo Graziosi a12a95eccc Add webhooks (#447)
2024-12-20 14:06:48 +01:00

48 lines
1.2 KiB
TypeScript

import * as React from 'react';
import { WebhookPages } from './WebhooksSiteSettingsP';
import Box from '../../common/Box';
import { IWebhook } from '../../../interfaces/IWebhook';
import WebhookForm, { ISiteSettingsWebhookFormUpdate } from './WebhookForm';
interface Props {
isSubmitting: boolean;
submitError: string;
handleSubmitWebhook(webhook: IWebhook): void;
handleUpdateWebhook(id: number, form: ISiteSettingsWebhookFormUpdate): void;
selectedWebhook: IWebhook;
page: WebhookPages;
setPage: React.Dispatch<React.SetStateAction<WebhookPages>>;
authenticityToken: string;
}
const WebhookFormPage = ({
isSubmitting,
submitError,
handleSubmitWebhook,
handleUpdateWebhook,
selectedWebhook,
page,
setPage,
authenticityToken,
}: Props) => (
<>
<Box customClass="webhookFormPage">
<WebhookForm
isSubmitting={isSubmitting}
submitError={submitError}
handleSubmitWebhook={handleSubmitWebhook}
handleUpdateWebhook={handleUpdateWebhook}
selectedWebhook={selectedWebhook}
page={page}
setPage={setPage}
authenticityToken={authenticityToken}
/>
</Box>
</>
);
export default WebhookFormPage;