2023-11-18 10:47:01 +00:00
|
|
|
import { ReactElement } from "react";
|
2023-11-20 15:16:49 +00:00
|
|
|
import useSWR from "swr";
|
|
|
|
import { observer } from "mobx-react-lite";
|
2023-11-18 10:47:01 +00:00
|
|
|
// layouts
|
2023-11-25 15:53:50 +00:00
|
|
|
import { InstanceAdminLayout } from "layouts/admin-layout";
|
2023-11-18 10:47:01 +00:00
|
|
|
// types
|
|
|
|
import { NextPageWithLayout } from "types/app";
|
2023-11-20 15:16:49 +00:00
|
|
|
// store
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
|
|
// ui
|
|
|
|
import { Loader } from "@plane/ui";
|
|
|
|
// components
|
2023-11-27 14:11:47 +00:00
|
|
|
import { InstanceEmailForm } from "components/instance";
|
2023-11-18 10:47:01 +00:00
|
|
|
|
2023-11-27 14:11:47 +00:00
|
|
|
const InstanceAdminEmailPage: NextPageWithLayout = observer(() => {
|
2023-11-20 15:16:49 +00:00
|
|
|
// store
|
|
|
|
const {
|
|
|
|
instance: { fetchInstanceConfigurations, formattedConfig },
|
|
|
|
} = useMobxStore();
|
|
|
|
|
|
|
|
useSWR("INSTANCE_CONFIGURATIONS", () => fetchInstanceConfigurations());
|
|
|
|
|
|
|
|
return (
|
2023-11-27 11:45:11 +00:00
|
|
|
<div className="flex flex-col gap-8">
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="mb-2 border-b border-custom-border-100 pb-3">
|
|
|
|
<div className="pb-1 text-xl font-medium text-custom-text-100">Secure emails from your own instance</div>
|
|
|
|
<div className="text-sm font-normal text-custom-text-300">
|
2023-11-25 15:53:50 +00:00
|
|
|
Plane can send useful emails to you and your users from your own instance without talking to the Internet.
|
|
|
|
</div>
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="text-sm font-normal text-custom-text-300">
|
2023-11-25 15:53:50 +00:00
|
|
|
Set it up below and please test your settings before you save them.{" "}
|
|
|
|
<span className="text-red-400">Misconfigs can lead to email bounces and errors.</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-11-20 15:16:49 +00:00
|
|
|
{formattedConfig ? (
|
|
|
|
<InstanceEmailForm config={formattedConfig} />
|
|
|
|
) : (
|
2023-11-25 15:53:50 +00:00
|
|
|
<Loader className="space-y-4">
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className="grid grid-cols-2 gap-x-8 gap-y-4">
|
2023-11-27 14:11:47 +00:00
|
|
|
<Loader.Item height="50px" />
|
|
|
|
<Loader.Item height="50px" />
|
|
|
|
</div>
|
2023-11-24 06:46:37 +00:00
|
|
|
<Loader.Item height="50px" />
|
|
|
|
</Loader>
|
2023-11-20 15:16:49 +00:00
|
|
|
)}
|
|
|
|
</div>
|
2023-11-24 06:46:37 +00:00
|
|
|
);
|
2023-11-20 15:16:49 +00:00
|
|
|
});
|
2023-11-18 10:47:01 +00:00
|
|
|
|
2023-11-27 14:11:47 +00:00
|
|
|
InstanceAdminEmailPage.getLayout = function getLayout(page: ReactElement) {
|
2023-11-25 15:53:50 +00:00
|
|
|
return <InstanceAdminLayout>{page}</InstanceAdminLayout>;
|
2023-11-18 10:47:01 +00:00
|
|
|
};
|
|
|
|
|
2023-11-27 14:11:47 +00:00
|
|
|
export default InstanceAdminEmailPage;
|