feat: versão 1.5 - CRM Beta com leads, funis, campanhas e portal do cliente

This commit is contained in:
Erik Silva
2025-12-24 17:36:52 -03:00
parent 99d828869a
commit dfb91c8ba5
98 changed files with 18255 additions and 1465 deletions

View File

@@ -0,0 +1,49 @@
import { getBranding } from '@/lib/branding';
import SucessoClient from './sucesso-client';
const lightenColor = (hexColor: string, amount = 20) => {
const fallback = '#3b82f6';
if (!hexColor) return fallback;
let color = hexColor.replace('#', '');
if (color.length === 3) {
color = color.split('').map(char => char + char).join('');
}
if (color.length !== 6) return fallback;
const num = parseInt(color, 16);
if (Number.isNaN(num)) return fallback;
const clamp = (value: number) => Math.max(0, Math.min(255, value));
const r = clamp((num >> 16) + amount);
const g = clamp(((num >> 8) & 0x00ff) + amount);
const b = clamp((num & 0x0000ff) + amount);
return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
};
export default async function CadastroSucessoPage() {
const branding = await getBranding();
const primaryColor = branding.primary_color || '#3b82f6';
const accentColor = lightenColor(primaryColor, 30);
const now = new Date();
const submittedAt = now.toLocaleString('pt-BR', {
day: '2-digit',
month: 'long',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
});
return (
<SucessoClient
branding={{
name: branding.name,
logo_url: branding.logo_url,
primary_color: primaryColor
}}
accentColor={accentColor}
submittedAt={submittedAt}
/>
);
}