Reorganiza el routing multi-tenant: funnel por slug, B2B en raíz
- / y /b2b sirven la landing B2B estática (rewrites beforeFiles)
- /{slug} resuelve el funnel del reformista (app/[slug]/page.tsx) con
branding propio (TenantBrand) y atribución de leads por tenant
- crearLead(slug) y páginas /solicitud usan el tenant del lead
- Panel: edición del slug del funnel + URL pública en /panel/empresa
- Helper de slugs reservados para evitar colisiones con rutas reales
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,7 @@ function validateForm(data: FormData): FormErrors {
|
||||
return errors;
|
||||
}
|
||||
|
||||
function LeadForm() {
|
||||
function LeadForm({ slug }: { slug: string }) {
|
||||
const router = useRouter();
|
||||
const [formData, setFormData] = useState<FormData>(initialData);
|
||||
const [consents, setConsents] = useState(initialConsents);
|
||||
@@ -79,7 +79,7 @@ function LeadForm() {
|
||||
|
||||
setStatus('loading');
|
||||
setSubmitError(null);
|
||||
const result = await crearLead({
|
||||
const result = await crearLead(slug, {
|
||||
nombre: formData.name,
|
||||
email: formData.email,
|
||||
telefono: formData.phone,
|
||||
@@ -326,7 +326,7 @@ function LeadForm() {
|
||||
);
|
||||
}
|
||||
|
||||
export default function Hero() {
|
||||
export default function Hero({ slug }: { slug: string }) {
|
||||
const heroRef = useRef<HTMLElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -393,7 +393,7 @@ export default function Hero() {
|
||||
<h2 className="text-xl font-black tracking-tight text-black">Pide tu presupuesto</h2>
|
||||
<p className="text-sm text-gray-400 mt-1">En menos de 2 minutos te llamamos · Render por WhatsApp</p>
|
||||
</div>
|
||||
<LeadForm />
|
||||
<LeadForm slug={slug} />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user