import React, { useEffect, useState } from 'react' import { useParams } from 'react-router-dom' import { useAuth0 } from '@auth0/auth0-react' import axios from 'axios' interface TenantInfo { id: string name: string status: string } const TenantSignup: React.FC = () => { const { tenantId } = useParams<{ tenantId: string }>() const { loginWithRedirect } = useAuth0() const [tenant, setTenant] = useState(null) const [loading, setLoading] = useState(true) const [error, setError] = useState(null) useEffect(() => { const fetchTenant = async () => { try { const response = await axios.get( `${import.meta.env.VITE_TENANTS_API_URL}/api/v1/tenants/${tenantId}` ) setTenant(response.data) } catch (err) { setError('Tenant not found or not accepting signups') } finally { setLoading(false) } } if (tenantId) { fetchTenant() } }, [tenantId]) const handleSignup = async () => { await loginWithRedirect({ authorizationParams: { screen_hint: 'signup', redirect_uri: `${window.location.origin}/callback` } }) } if (loading) { return
Loading...
} if (error || !tenant) { return (

Tenant Not Found

{error}

Return to Homepage
) } return (

Join {tenant.name}

Create your account to get started

What happens next?

  1. Create your account with Auth0
  2. Your signup request will be sent to the tenant administrator
  3. Once approved, you'll receive access to {tenant.name}
  4. Login at {tenant.id}.motovaultpro.com
← Back to Homepage
) } export default TenantSignup