diff --git a/src/features/home/pages/home-page.tsx b/src/features/home/pages/home-page.tsx index 3c2da9f..d1ceeff 100644 --- a/src/features/home/pages/home-page.tsx +++ b/src/features/home/pages/home-page.tsx @@ -16,6 +16,7 @@ import { import { ArrowDown, ArrowRight, Check } from 'lucide-react' import { BackgroundBlobs } from '@/shared/components/background-blobs' import { Footer } from '@/features/home/components/footer' +import { Link } from 'react-router-dom' const plans = [ { @@ -130,7 +131,8 @@ const owners = [ { name: 'Júlia Galhardi Cerqueira', image: 'https://d1b8zs4rmj3xdl.cloudfront.net/julia.jpeg', - role: 'Estagiária' + role: 'Estagiária', + linkedin: 'https://www.linkedin.com/in/j%C3%BAliacerqueira/' }, { name: 'Vinícius Berti', @@ -255,14 +257,16 @@ export function HomePage() { transition={transition} variants={variants} > - - + + + - + @@ -444,9 +448,9 @@ export function HomePage() { variants={variants} > {owners.map((owner, index) => ( - - + ))} diff --git a/src/features/sign-up/pages/sign-up-page.tsx b/src/features/sign-up/pages/sign-up-page.tsx index 7107a90..37d5ae0 100644 --- a/src/features/sign-up/pages/sign-up-page.tsx +++ b/src/features/sign-up/pages/sign-up-page.tsx @@ -27,11 +27,6 @@ import { zodResolver } from '@hookform/resolvers/zod' import { useForm } from 'react-hook-form' import { Checkbox } from '@/shared/components/checkbox' import { Label } from '@/shared/components/label' -import { - formatCNPJ, - formatCPF, - formatPhone -} from '@/shared/utils/format-documents' import toast from 'react-hot-toast' import { BackgroundBlobs } from '@/shared/components/background-blobs' import { motion } from 'framer-motion' @@ -41,6 +36,12 @@ import { containerVariants, cardVariants } from '@/shared/utils/animations' import { useCreateUserMutation } from '@/shared/hooks/use-user' import { AxiosError } from 'axios' import { useNavigate } from 'react-router-dom' +import { DOCUMENT_TYPE } from '@/shared/enums/document-type' +import { + handleCNPJChange, + handleCPFChange, + handlePhoneChange +} from '@/shared/utils/string-extensions' export function SignUpPage() { const [showPassword, setShowPassword] = useState(false) @@ -55,33 +56,9 @@ export function SignUpPage() { mode: 'onBlur' }) - const handleCPFChange = ( - value: string, - onChange: (value: string) => void - ) => { - const formattedValue = formatCPF(value) - onChange(formattedValue) - } - - const handleCNPJChange = ( - value: string, - onChange: (value: string) => void - ) => { - const formattedValue = formatCNPJ(value) - onChange(formattedValue) - } - - const handlePhoneChange = ( - value: string, - onChange: (value: string) => void - ) => { - const formattedValue = formatPhone(value) - onChange(formattedValue) - } - async function onSubmit(values: SignUpFormData) { try { - const isIndividual = values.documentType === 'individual' + const isIndividual = values.documentType === DOCUMENT_TYPE.INDIVIDUAL // Convert birthDate to seconds since epoch if provided const birthDateSeconds = values.birthDate @@ -196,9 +173,11 @@ export function SignUpPage() { > { - field.onChange('individual') + field.onChange(DOCUMENT_TYPE.INDIVIDUAL) form.setValue('document', '') }} /> @@ -210,9 +189,9 @@ export function SignUpPage() { > { - field.onChange('business') + field.onChange(DOCUMENT_TYPE.BUSINESS) form.setValue('document', '') form.setValue('birthDate', undefined) }} @@ -231,7 +210,8 @@ export function SignUpPage() { render={({ field }) => ( - {form.getValues('documentType') === 'individual' + {form.getValues('documentType') === + DOCUMENT_TYPE.INDIVIDUAL ? 'CPF' : 'CNPJ'} @@ -240,7 +220,8 @@ export function SignUpPage() { {...field} onChange={(e) => { if ( - form.getValues('documentType') === 'individual' + form.getValues('documentType') === + DOCUMENT_TYPE.INDIVIDUAL ) { handleCPFChange(e.target.value, field.onChange) } else { @@ -248,12 +229,14 @@ export function SignUpPage() { } }} placeholder={ - form.getValues('documentType') === 'individual' + form.getValues('documentType') === + DOCUMENT_TYPE.INDIVIDUAL ? '000.000.000-00' : '00.000.000/0000-00' } maxLength={ - form.getValues('documentType') === 'individual' + form.getValues('documentType') === + DOCUMENT_TYPE.INDIVIDUAL ? 14 : 18 } @@ -263,7 +246,8 @@ export function SignUpPage() { )} /> - {form.getValues('documentType') === 'individual' && ( + {form.getValues('documentType') === + DOCUMENT_TYPE.INDIVIDUAL && ( - + {knowledgeBase.displayName} {knowledgeBase.status} @@ -287,31 +287,35 @@ echo $data['response'];` {/* Informações gerais */}
- - Criada em: - -

{knowledgeBase.createdAt.toLocaleDateString('pt-BR')}

+ Criada em: +

+ {knowledgeBase.createdAt.toLocaleDateString('pt-BR')} +

- + Última modificação: -

{knowledgeBase.updatedAt.toLocaleDateString('pt-BR')}

+

+ {knowledgeBase.updatedAt.toLocaleDateString('pt-BR')} +

- + Total de arquivos: -

+

{knowledgeBase.files.length} arquivo {knowledgeBase.files.length !== 1 ? 's' : ''}

- + Tamanho total: -

{knowledgeBase.totalSizeMB.toFixed(1)} MB

+

+ {knowledgeBase.totalSizeMB.toFixed(1)} MB +

@@ -319,9 +323,9 @@ echo $data['response'];` {/* API Keys */}
-

API Keys

+

API Keys

{knowledgeBase.keys.length === 0 ? ( -
+
Nenhuma chave de API encontrada
) : ( @@ -337,12 +341,12 @@ echo $data['response'];` className="hover:bg-muted/50 border-border rounded-lg border-1 p-4 transition-colors" >
- + {key.kbKeyAlias}
-
+
{isVisible ? key.kbKey : maskKey(key.kbKey)}
@@ -386,13 +390,15 @@ echo $data['response'];` className="hover:bg-muted/50 flex w-full items-center justify-between rounded-lg p-2 transition-colors" >
- -

Exemplos de Código

+ +

+ Exemplos de Código +

{isCodeSectionExpanded ? ( - + ) : ( - + )} @@ -405,7 +411,7 @@ echo $data['response'];` >
{knowledgeBase.keys.length === 0 ? ( -
+
Crie uma API Key para ver os exemplos de código
) : ( @@ -418,9 +424,11 @@ echo $data['response'];` onClick={() => setSelectedLanguage(lang.id)} size="sm" variant={ - selectedLanguage === lang.id ? 'default' : 'outline' + selectedLanguage === lang.id + ? 'secondary' + : 'outline' } - className="flex items-center gap-1.5" + className="text-foreground flex items-center gap-1.5" > {lang.icon} {lang.name} @@ -468,12 +476,14 @@ echo $data['response'];` {/* Lista de arquivos */}
-

Arquivos

+

+ Arquivos +

{knowledgeBase.files.length === 0 ? ( -
+

Nenhum arquivo encontrado

@@ -499,12 +509,12 @@ echo $data['response'];`

{file.fileName}

-

+

{formatFileSize(file.sizeMB)}

@@ -528,7 +538,11 @@ echo $data['response'];` {/* Botões de ação */}
-