import { useActionData, useCatch, useTransition } from "@remix-run/react"; import Button from "../button"; import SettingsSection from "../settings-section"; import Alert from "~/features/core/components/alert"; export default function PhoneNumberForm() { const transition = useTransition(); const actionData = useActionData(); const isSubmitting = transition.state === "submitting"; const isSuccess = actionData?.submitted === true; const error = actionData?.error; const isError = !!error; const hasFilledTwilioCredentials = false; // Boolean(currentOrganization?.twilioAccountSid && currentOrganization?.twilioAuthToken) const availablePhoneNumbers: any[] = []; const onSubmit = async () => { // await setPhoneNumberMutation({ phoneNumberSid }); // TODO }; if (!hasFilledTwilioCredentials) { return null; } return (
); } export function CatchBoundary() { const caught = useCatch(); return (We failed to fetch your Twilio phone numbers. Make sure both your SID and your auth token are valid and that your Twilio account isn't suspended. {caught.data ? Related Twilio docs : null}
> } /> ); }