@@ -87,21 +117,7 @@ export default function WorkflowTriggersPage() {
{
- if (row.type === "webhook") {
- navigate(
- $path("/workflow-triggers/webhooks/:webhook", {
- webhook: row.id,
- })
- );
- } else {
- navigate(
- $path("/workflow-triggers/schedule/:trigger", {
- trigger: row.id,
- })
- );
- }
- }}
+ onRowClick={onNavigate}
columns={getColumns()}
data={tableData}
/>
diff --git a/ui/admin/app/routes/_auth.workflow-triggers.email.$receiver.tsx b/ui/admin/app/routes/_auth.workflow-triggers.email.$receiver.tsx
new file mode 100644
index 00000000..b7b8585a
--- /dev/null
+++ b/ui/admin/app/routes/_auth.workflow-triggers.email.$receiver.tsx
@@ -0,0 +1,56 @@
+import {
+ ClientLoaderFunctionArgs,
+ MetaFunction,
+ useLoaderData,
+ useMatch,
+} from "react-router";
+import useSWR, { preload } from "swr";
+
+import { EmailReceiverApiService } from "~/lib/service/api/emailReceiverApiService";
+import { RouteHandle } from "~/lib/service/routeHandles";
+import { RouteService } from "~/lib/service/routeService";
+
+import { EmailReceiverForm } from "~/components/workflow-triggers/EmailReceiverForm";
+
+export async function clientLoader({
+ request,
+ params,
+}: ClientLoaderFunctionArgs) {
+ const { pathParams } = RouteService.getRouteInfo(
+ "/workflow-triggers/email/:receiver",
+ new URL(request.url),
+ params
+ );
+
+ await preload(
+ EmailReceiverApiService.getEmailReceiverById.key(pathParams.receiver),
+ () => EmailReceiverApiService.getEmailReceiverById(pathParams.receiver)
+ );
+
+ return { emailReceiverId: pathParams.receiver };
+}
+
+export default function EmailReceiverPage() {
+ const { emailReceiverId } = useLoaderData();
+ const { data: emailReceiver } = useSWR(
+ EmailReceiverApiService.getEmailReceiverById.key(emailReceiverId),
+ ({ emailReceiverId }) =>
+ EmailReceiverApiService.getEmailReceiverById(emailReceiverId)
+ );
+
+ return ;
+}
+
+const EmailReceiverBreadcrumb = () => {
+ const match = useMatch("/workflow-triggers/email/:receiver");
+
+ return match?.params?.receiver || "Edit";
+};
+
+export const handle: RouteHandle = {
+ breadcrumb: () => [{ content: }],
+};
+
+export const meta: MetaFunction = ({ data }) => {
+ return [{ title: `Email Receiver • ${data?.emailReceiverId}` }];
+};
diff --git a/ui/admin/app/routes/_auth.workflow-triggers.email.create.tsx b/ui/admin/app/routes/_auth.workflow-triggers.email.create.tsx
new file mode 100644
index 00000000..c729653c
--- /dev/null
+++ b/ui/admin/app/routes/_auth.workflow-triggers.email.create.tsx
@@ -0,0 +1,17 @@
+import { MetaFunction } from "react-router";
+
+import { RouteHandle } from "~/lib/service/routeHandles";
+
+import { EmailReceiverForm } from "~/components/workflow-triggers/EmailReceiverForm";
+
+export default function CreateEmailReceiverPage() {
+ return ;
+}
+
+export const handle: RouteHandle = {
+ breadcrumb: () => [{ content: "Create Email Receiver" }],
+};
+
+export const meta: MetaFunction = () => {
+ return [{ title: "Create Email Receiver" }];
+};