import { useState } from 'react'; import { Card, Input, Button, FormField, Alert } from '@cameleer/design-system'; import cameleerLogo from '@cameleer/design-system/assets/cameleer-logo.svg'; import { api } from '../api/client'; import { toSlug } from '../utils/slug'; import styles from './OnboardingPage.module.css'; interface TenantResponse { id: string; name: string; slug: string; status: string; } export function OnboardingPage() { const [name, setName] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const slug = toSlug(name); async function handleSubmit(e: React.FormEvent) { e.preventDefault(); setError(null); setLoading(true); try { await api.post('/onboarding/tenant', { name, slug }); // Tenant created — force a full page reload so the Logto SDK // picks up the new org membership and scopes on the next token refresh. window.location.href = '/platform/'; } catch (err) { setError(err instanceof Error ? err.message : 'Failed to create tenant'); setLoading(false); } } return (
Welcome to Cameleer

Set up your workspace to start monitoring your Camel routes.

{error && (
{error}
)}
setName(e.target.value)} placeholder="Acme Corp" autoFocus disabled={loading} required />
); }