2022-05-21 23:59:38 +00:00
|
|
|
import type { MetaFunction } from "@remix-run/node";
|
|
|
|
import { useLoaderData } from "superjson-remix";
|
2022-05-14 10:22:06 +00:00
|
|
|
|
|
|
|
import MissingTwilioCredentials from "~/features/core/components/missing-twilio-credentials";
|
|
|
|
import PageTitle from "~/features/core/components/page-title";
|
|
|
|
import PhoneCallsList from "~/features/phone-calls/components/phone-calls-list";
|
2022-05-21 23:59:38 +00:00
|
|
|
import callsLoader, { type PhoneCallsLoaderData } from "~/features/phone-calls/loaders/calls";
|
|
|
|
import { getSeoMeta } from "~/utils/seo";
|
2022-05-14 10:22:06 +00:00
|
|
|
|
2022-05-21 23:59:38 +00:00
|
|
|
export const meta: MetaFunction = () => ({
|
|
|
|
...getSeoMeta({ title: "Calls" }),
|
|
|
|
});
|
2022-05-14 10:22:06 +00:00
|
|
|
|
2022-05-21 23:59:38 +00:00
|
|
|
export const loader = callsLoader;
|
2022-05-14 10:22:06 +00:00
|
|
|
|
|
|
|
export default function PhoneCalls() {
|
2023-04-29 16:30:07 +00:00
|
|
|
const { hasPhoneNumber } = useLoaderData<PhoneCallsLoaderData>();
|
2022-05-14 10:22:06 +00:00
|
|
|
|
2022-05-17 23:54:06 +00:00
|
|
|
if (!hasPhoneNumber) {
|
2022-05-14 10:22:06 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<MissingTwilioCredentials />
|
|
|
|
<PageTitle className="filter blur-sm select-none absolute top-0" title="Calls" />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<PageTitle className="pl-12" title="Calls" />
|
|
|
|
<section className="flex flex-grow flex-col">
|
2022-05-17 23:54:06 +00:00
|
|
|
<PhoneCallsList />
|
2022-05-14 10:22:06 +00:00
|
|
|
</section>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|