2020-07-22 10:54:15 +00:00
|
|
|
import WebhooksCreateView from "@saleor/webhooks/views/WebhooksCreate";
|
2019-10-09 06:01:52 +00:00
|
|
|
import React from "react";
|
2020-07-22 10:54:15 +00:00
|
|
|
import { Route, RouteComponentProps } from "react-router-dom";
|
2019-10-09 06:01:52 +00:00
|
|
|
|
2020-07-22 10:54:15 +00:00
|
|
|
import { webhookAddPath, webhookPath } from "./urls";
|
2019-10-09 07:31:00 +00:00
|
|
|
import WebhooksDetails from "./views/WebhooksDetails";
|
2019-10-09 06:01:52 +00:00
|
|
|
|
2020-07-22 10:54:15 +00:00
|
|
|
const WebhookDetails: React.FC<RouteComponentProps<any>> = ({ match }) => (
|
|
|
|
<WebhooksDetails id={decodeURIComponent(match.params.id)} />
|
|
|
|
);
|
2019-12-17 17:13:56 +00:00
|
|
|
|
2020-07-22 10:54:15 +00:00
|
|
|
const WebhookCreate: React.FC<RouteComponentProps<any>> = ({ match }) => (
|
|
|
|
<WebhooksCreateView id={decodeURIComponent(match.params.id)} />
|
|
|
|
);
|
2019-10-09 06:01:52 +00:00
|
|
|
|
2020-07-22 10:54:15 +00:00
|
|
|
const Component = () => (
|
|
|
|
<>
|
|
|
|
<Route exact path={webhookAddPath(":id")} component={WebhookCreate} />
|
|
|
|
<Route path={webhookPath(":id")} component={WebhookDetails} />
|
|
|
|
</>
|
|
|
|
);
|
2019-10-09 06:01:52 +00:00
|
|
|
|
|
|
|
export default Component;
|