shellphone.app/app/routes/__app/calls.tsx

37 lines
1.0 KiB
TypeScript
Raw Normal View History

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() {
const { hasPhoneNumber } = useLoaderData<PhoneCallsLoaderData>();
2022-05-14 10:22: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">
<PhoneCallsList />
2022-05-14 10:22:06 +00:00
</section>
</>
);
}