|
@@ -0,0 +1,427 @@
|
|
|
|
|
+<script>
|
|
|
|
|
+ import { goto } from '$app/navigation';
|
|
|
|
|
+ import { browser } from '$app/environment';
|
|
|
|
|
+ import { onMount, onDestroy } from 'svelte';
|
|
|
|
|
+ import { companyId as companyIdStore } from '$lib/utils/stores';
|
|
|
|
|
+
|
|
|
|
|
+ const apiUrl = import.meta.env.VITE_API_URL;
|
|
|
|
|
+
|
|
|
|
|
+ let name = '';
|
|
|
|
|
+ let email = '';
|
|
|
|
|
+ let password = '';
|
|
|
|
|
+ let confirmPassword = '';
|
|
|
|
|
+ let loading = false;
|
|
|
|
|
+ let error = '';
|
|
|
|
|
+ let success = '';
|
|
|
|
|
+
|
|
|
|
|
+ let step = 1;
|
|
|
|
|
+
|
|
|
|
|
+ let companyName = '';
|
|
|
|
|
+ let companyId = '';
|
|
|
|
|
+ let companyFlag = 'ACTIVE';
|
|
|
|
|
+ let companyCnpj = '';
|
|
|
|
|
+
|
|
|
|
|
+ let phone = '';
|
|
|
|
|
+ let address = '';
|
|
|
|
|
+ let city = '';
|
|
|
|
|
+ let stateUF = '';
|
|
|
|
|
+ let zip = '';
|
|
|
|
|
+ let country = 'BR';
|
|
|
|
|
+ let kyc = 1;
|
|
|
|
|
+ let birthdate = '';
|
|
|
|
|
+ let cpf = '';
|
|
|
|
|
+ let roleId = 1;
|
|
|
|
|
+
|
|
|
|
|
+ const companyEndpoint = `${apiUrl}/companies`;
|
|
|
|
|
+ const ownerEndpoint = `${apiUrl}/users`;
|
|
|
|
|
+
|
|
|
|
|
+ function setDark(enabled) {
|
|
|
|
|
+ if (enabled) document.documentElement.classList.add('dark');
|
|
|
|
|
+ else document.documentElement.classList.remove('dark');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function applyDarkModeFromStorage() {
|
|
|
|
|
+ if (!browser) return;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const saved = localStorage.getItem('darkmode');
|
|
|
|
|
+ if (saved === 'true') setDark(true);
|
|
|
|
|
+ else if (saved === 'false') setDark(false);
|
|
|
|
|
+ else setDark(window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
|
|
|
+ } catch (e) {}
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ onMount(() => {
|
|
|
|
|
+ applyDarkModeFromStorage();
|
|
|
|
|
+ const onStorage = (e) => {
|
|
|
|
|
+ if (e.key === 'darkmode') applyDarkModeFromStorage();
|
|
|
|
|
+ };
|
|
|
|
|
+ window.addEventListener('storage', onStorage);
|
|
|
|
|
+ onDestroy(() => {
|
|
|
|
|
+ window.removeEventListener('storage', onStorage);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ async function onSubmit(e) {
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ error = '';
|
|
|
|
|
+ success = '';
|
|
|
|
|
+ loading = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (step === 1) {
|
|
|
|
|
+ if (!companyName || !companyCnpj) {
|
|
|
|
|
+ throw new Error('Preencha os dados da empresa.');
|
|
|
|
|
+ }
|
|
|
|
|
+ step = 2;
|
|
|
|
|
+ loading = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!name || !email || !password || !confirmPassword || !phone || !address || !city || !stateUF || !zip || !cpf || !birthdate) {
|
|
|
|
|
+ throw new Error('Preencha todos os campos.');
|
|
|
|
|
+ }
|
|
|
|
|
+ if (password !== confirmPassword) {
|
|
|
|
|
+ throw new Error('As senhas não coincidem.');
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!browser) {
|
|
|
|
|
+ throw new Error('Ação disponível apenas no navegador.');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const companyPayload = {
|
|
|
|
|
+ name: companyName,
|
|
|
|
|
+ companyCnpj: companyCnpj,
|
|
|
|
|
+ flag: "ACTIVE"
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ function toBirthdateInt(s) {
|
|
|
|
|
+ if (!s) return 0;
|
|
|
|
|
+ const parts = s.split('-');
|
|
|
|
|
+ if (parts.length !== 3) return 0;
|
|
|
|
|
+ const yyyy = parseInt(parts[0], 10);
|
|
|
|
|
+ const mm = parseInt(parts[1], 10);
|
|
|
|
|
+ const dd = parseInt(parts[2], 10);
|
|
|
|
|
+ if (!yyyy || !mm || !dd) return 0;
|
|
|
|
|
+ return yyyy * 10000 + mm * 100 + dd;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const ownerPayload = {
|
|
|
|
|
+ name,
|
|
|
|
|
+ email,
|
|
|
|
|
+ password,
|
|
|
|
|
+ phone,
|
|
|
|
|
+ address,
|
|
|
|
|
+ city,
|
|
|
|
|
+ state: stateUF,
|
|
|
|
|
+ zip,
|
|
|
|
|
+ country,
|
|
|
|
|
+ kyc: Number(kyc),
|
|
|
|
|
+ birthdate: toBirthdateInt(birthdate),
|
|
|
|
|
+ cpf,
|
|
|
|
|
+ companyId: Number($companyIdStore ?? companyId),
|
|
|
|
|
+ roleId: Number(roleId),
|
|
|
|
|
+ flag: "ACTIVE"
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const resCompany = await fetch(companyEndpoint, {
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ headers: { 'content-type': 'application/json' },
|
|
|
|
|
+ body: JSON.stringify(companyPayload)
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (!resCompany.ok) {
|
|
|
|
|
+ let msg = 'Falha ao cadastrar empresa.';
|
|
|
|
|
+ try {
|
|
|
|
|
+ const err = await resCompany.json();
|
|
|
|
|
+ if (err?.message) msg = err.message;
|
|
|
|
|
+ } catch {}
|
|
|
|
|
+ throw new Error(msg);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const resOwner = await fetch(ownerEndpoint, {
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ headers: { 'content-type': 'application/json' },
|
|
|
|
|
+ body: JSON.stringify(ownerPayload)
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (!resOwner.ok) {
|
|
|
|
|
+ let msg = 'Falha ao cadastrar proprietário.';
|
|
|
|
|
+ try {
|
|
|
|
|
+ const err = await resOwner.json();
|
|
|
|
|
+ if (err?.message) msg = err.message;
|
|
|
|
|
+ } catch {}
|
|
|
|
|
+ throw new Error(msg);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ success = 'Conta criada com sucesso. Você já pode entrar.';
|
|
|
|
|
+ setTimeout(() => goto('/'), 800);
|
|
|
|
|
+ } catch (err) {
|
|
|
|
|
+ error = err?.message ?? 'Falha no cadastro, tente novamente.';
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ loading = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<div class="min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 px-4">
|
|
|
|
|
+ <div class="w-full max-w-md">
|
|
|
|
|
+ <div class="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm p-8">
|
|
|
|
|
+ <h1 class="text-2xl font-semibold text-gray-900 dark:text-gray-100 mb-2">Criar conta</h1>
|
|
|
|
|
+ <p class="text-sm text-gray-600 dark:text-gray-400 mb-6">
|
|
|
|
|
+ {#if step === 1}
|
|
|
|
|
+ Etapa 1 de 2: Dados da empresa
|
|
|
|
|
+ {:else}
|
|
|
|
|
+ Etapa 2 de 2: Dados do proprietário
|
|
|
|
|
+ {/if}
|
|
|
|
|
+ </p>
|
|
|
|
|
+
|
|
|
|
|
+ {#if error}
|
|
|
|
|
+ <div class="mb-4 rounded border border-red-300 bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-300 px-3 py-2 text-sm">{error}</div>
|
|
|
|
|
+ {/if}
|
|
|
|
|
+ {#if success}
|
|
|
|
|
+ <div class="mb-4 rounded border border-green-300 bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-300 px-3 py-2 text-sm">{success}</div>
|
|
|
|
|
+ {/if}
|
|
|
|
|
+
|
|
|
|
|
+ <form on:submit|preventDefault={onSubmit} class="space-y-4">
|
|
|
|
|
+ {#if step === 1}
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="companyName">Nome da empresa</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="companyName"
|
|
|
|
|
+ name="companyName"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={companyName}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="Minha Empresa"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="companyCnpj">CNPJ</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="companyCnpj"
|
|
|
|
|
+ name="companyCnpj"
|
|
|
|
|
+ type="number"
|
|
|
|
|
+ inputmode="numeric"
|
|
|
|
|
+ bind:value={companyCnpj}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <button
|
|
|
|
|
+ class="w-full inline-flex items-center justify-center rounded bg-blue-600 hover:bg-blue-700 text-white font-medium px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60"
|
|
|
|
|
+ disabled={loading}
|
|
|
|
|
+ type="submit"
|
|
|
|
|
+ >
|
|
|
|
|
+ {#if loading}
|
|
|
|
|
+ Continuando...
|
|
|
|
|
+ {:else}
|
|
|
|
|
+ Continuar
|
|
|
|
|
+ {/if}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ {:else}
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="ownerName">Nome do proprietário</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="ownerName"
|
|
|
|
|
+ name="ownerName"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={name}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="John Doe"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="email">E-mail</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="email"
|
|
|
|
|
+ name="email"
|
|
|
|
|
+ type="email"
|
|
|
|
|
+ bind:value={email}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="email@exemplo.com"
|
|
|
|
|
+ autocomplete="email"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="password">Senha</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="password"
|
|
|
|
|
+ name="password"
|
|
|
|
|
+ type="password"
|
|
|
|
|
+ bind:value={password}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="••••••••"
|
|
|
|
|
+ autocomplete="new-password"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="confirm">Confirmar senha</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="confirm"
|
|
|
|
|
+ name="confirm"
|
|
|
|
|
+ type="password"
|
|
|
|
|
+ bind:value={confirmPassword}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="••••••••"
|
|
|
|
|
+ autocomplete="new-password"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="phone">Telefone</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="phone"
|
|
|
|
|
+ name="phone"
|
|
|
|
|
+ type="tel"
|
|
|
|
|
+ bind:value={phone}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="+55 11 99999-9999"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="address">Endereço</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="address"
|
|
|
|
|
+ name="address"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={address}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="Av. Paulista, 1000"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
|
|
|
+ <div class="sm:col-span-2">
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="city">Cidade</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="city"
|
|
|
|
|
+ name="city"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={city}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="São Paulo"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="stateUF">UF</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="stateUF"
|
|
|
|
|
+ name="stateUF"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ maxlength="2"
|
|
|
|
|
+ bind:value={stateUF}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="SP"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="zip">CEP</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="zip"
|
|
|
|
|
+ name="zip"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={zip}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="01310-100"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="sm:col-span-2">
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="country">País</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="country"
|
|
|
|
|
+ name="country"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={country}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="BR"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="kyc">KYC</label>
|
|
|
|
|
+ <select
|
|
|
|
|
+ id="kyc"
|
|
|
|
|
+ name="kyc"
|
|
|
|
|
+ bind:value={kyc}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ required
|
|
|
|
|
+ >
|
|
|
|
|
+ <option value="1">1 (Sim)</option>
|
|
|
|
|
+ <option value="0">0 (Não)</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="sm:col-span-2">
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="birthdate">Data de nascimento</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="birthdate"
|
|
|
|
|
+ name="birthdate"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ bind:value={birthdate}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1" for="cpf">CPF</label>
|
|
|
|
|
+ <input
|
|
|
|
|
+ id="cpf"
|
|
|
|
|
+ name="cpf"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ bind:value={cpf}
|
|
|
|
|
+ class="w-full rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
|
|
+ placeholder="123.456.789-00"
|
|
|
|
|
+ required
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="flex gap-3">
|
|
|
|
|
+ <button
|
|
|
|
|
+ type="button"
|
|
|
|
|
+ class="w-1/3 inline-flex items-center justify-center rounded border border-gray-300 dark:border-gray-600 text-gray-800 dark:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800 font-medium px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60"
|
|
|
|
|
+ on:click={() => step = 1}
|
|
|
|
|
+ disabled={loading}
|
|
|
|
|
+ >Voltar</button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ class="w-2/3 inline-flex items-center justify-center rounded bg-blue-600 hover:bg-blue-700 text-white font-medium px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60"
|
|
|
|
|
+ disabled={loading}
|
|
|
|
|
+ type="submit"
|
|
|
|
|
+ >
|
|
|
|
|
+ {#if loading}
|
|
|
|
|
+ Enviando...
|
|
|
|
|
+ {:else}
|
|
|
|
|
+ Concluir cadastro
|
|
|
|
|
+ {/if}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {/if}
|
|
|
|
|
+ </form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <p class="mt-6 text-center text-sm text-gray-600 dark:text-gray-400">
|
|
|
|
|
+ Já tem conta? <a href="/" class="text-blue-600 hover:text-blue-500">Entrar</a>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</div>
|