feat: CMS com limites de caracteres, traduções auto e painel de notificações
This commit is contained in:
@@ -2,22 +2,19 @@
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePageContent } from "@/hooks/usePageContent";
|
||||
import { useTranslatedContent, T } from "@/components/TranslatedText";
|
||||
|
||||
export default function Home() {
|
||||
const { content, loading } = usePageContent('home');
|
||||
|
||||
// Traduzir conteúdo do banco automaticamente
|
||||
const { translatedContent } = useTranslatedContent(content);
|
||||
// Português é o idioma padrão - busca diretamente sem tradução
|
||||
const { content, loading } = usePageContent('home', 'pt');
|
||||
|
||||
// Usar conteúdo traduzido ou fallback
|
||||
const hero = translatedContent?.hero || {
|
||||
// Usar conteúdo do banco ou fallback
|
||||
const hero = content?.hero || {
|
||||
title: 'Engenharia de Excelência para Seus Projetos',
|
||||
subtitle: 'Soluções completas em engenharia veicular, mecânica e segurança do trabalho com mais de 15 anos de experiência.',
|
||||
buttonText: 'Conheça Nossos Serviços'
|
||||
};
|
||||
|
||||
const features = translatedContent?.features || {
|
||||
const features = content?.features || {
|
||||
pretitle: 'Por que nos escolher',
|
||||
title: 'Nossos Diferenciais',
|
||||
items: [
|
||||
@@ -27,7 +24,7 @@ export default function Home() {
|
||||
] as Array<{ icon: string; title: string; description: string }>
|
||||
};
|
||||
|
||||
const services = translatedContent?.services || {
|
||||
const services = content?.services || {
|
||||
pretitle: 'Nossos Serviços',
|
||||
title: 'O Que Fazemos',
|
||||
items: [
|
||||
@@ -38,7 +35,7 @@ export default function Home() {
|
||||
] as Array<{ icon: string; title: string; description: string }>
|
||||
};
|
||||
|
||||
const about = translatedContent?.about || {
|
||||
const about = content?.about || {
|
||||
pretitle: 'Conheça a OCCTO',
|
||||
title: 'Sobre Nós',
|
||||
description: 'Com mais de 15 anos de experiência, a OCCTO Engenharia se consolidou como referência em soluções de engenharia.',
|
||||
@@ -49,7 +46,7 @@ export default function Home() {
|
||||
] as string[]
|
||||
};
|
||||
|
||||
const testimonials = translatedContent?.testimonials || {
|
||||
const testimonials = content?.testimonials || {
|
||||
pretitle: 'Depoimentos',
|
||||
title: 'O Que Dizem Nossos Clientes',
|
||||
items: [
|
||||
@@ -59,13 +56,13 @@ export default function Home() {
|
||||
] as Array<{ name: string; role: string; text: string }>
|
||||
};
|
||||
|
||||
const stats = translatedContent?.stats || {
|
||||
const stats = content?.stats || {
|
||||
clients: '500+',
|
||||
projects: '1200+',
|
||||
years: '15'
|
||||
};
|
||||
|
||||
const cta = translatedContent?.cta || {
|
||||
const cta = content?.cta || {
|
||||
title: 'Pronto para tirar seu projeto do papel?',
|
||||
text: 'Entre em contato com nossa equipe de especialistas.',
|
||||
button: 'Fale Conosco'
|
||||
@@ -83,7 +80,7 @@ export default function Home() {
|
||||
<div className="max-w-3xl">
|
||||
<div className="inline-flex items-center gap-3 bg-white/10 backdrop-blur-md border border-white/20 rounded-full px-5 py-2 mb-8 hover:bg-white/20 transition-colors cursor-default">
|
||||
<i className="ri-verified-badge-fill text-primary text-xl"></i>
|
||||
<span className="text-sm font-bold tracking-wider uppercase text-white"><T>Prestador de Serviço Oficial</T> <span className="text-primary">Coca-Cola</span></span>
|
||||
<span className="text-sm font-bold tracking-wider uppercase text-white">Prestador de Serviço Oficial <span className="text-primary">Coca-Cola</span></span>
|
||||
</div>
|
||||
|
||||
<h1 className="text-5xl md:text-6xl font-bold font-headline mb-6 leading-tight">
|
||||
@@ -97,7 +94,7 @@ export default function Home() {
|
||||
{hero.buttonText}
|
||||
</Link>
|
||||
<Link href="/projetos" className="px-8 py-4 border-2 border-white text-white rounded-lg font-bold hover:bg-white hover:text-secondary transition-colors text-center">
|
||||
<T>Ver Soluções</T>
|
||||
Ver Soluções
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -145,7 +142,7 @@ export default function Home() {
|
||||
</div>
|
||||
<div className="text-center mt-12">
|
||||
<Link href="/servicos" className="text-primary font-bold hover:text-secondary dark:hover:text-white transition-colors inline-flex items-center gap-2">
|
||||
<T>Ver todos os serviços</T> <i className="ri-arrow-right-line"></i>
|
||||
Ver todos os serviços <i className="ri-arrow-right-line"></i>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -175,7 +172,7 @@ export default function Home() {
|
||||
))}
|
||||
</ul>
|
||||
<Link href="/sobre" className="text-primary font-bold hover:text-white transition-colors flex items-center gap-2">
|
||||
<T>Conheça nossa expertise</T> <i className="ri-arrow-right-line"></i>
|
||||
Conheça nossa expertise <i className="ri-arrow-right-line"></i>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -186,11 +183,11 @@ export default function Home() {
|
||||
<div className="container mx-auto px-4">
|
||||
<div className="flex flex-col md:flex-row justify-between items-start md:items-end mb-12 gap-4">
|
||||
<div>
|
||||
<h2 className="text-primary font-bold tracking-wider uppercase mb-2"><T>Portfólio</T></h2>
|
||||
<h3 className="text-4xl font-bold font-headline text-secondary dark:text-white"><T>Projetos Recentes</T></h3>
|
||||
<h2 className="text-primary font-bold tracking-wider uppercase mb-2">Portfólio</h2>
|
||||
<h3 className="text-4xl font-bold font-headline text-secondary dark:text-white">Projetos Recentes</h3>
|
||||
</div>
|
||||
<Link href="/projetos" className="px-6 py-3 border border-secondary dark:border-white text-secondary dark:text-white rounded-lg font-bold hover:bg-secondary hover:text-white dark:hover:bg-white dark:hover:text-secondary transition-colors">
|
||||
<T>Ver todos os projetos</T>
|
||||
Ver todos os projetos
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -204,11 +201,11 @@ export default function Home() {
|
||||
<div className="absolute inset-0 bg-cover bg-center transition-transform duration-500 group-hover:scale-110" style={{ backgroundImage: `url('${project.img}')` }}></div>
|
||||
<div className="absolute inset-0 bg-linear-to-t from-black/90 via-black/20 to-transparent opacity-80 group-hover:opacity-90 transition-opacity"></div>
|
||||
<div className="absolute bottom-0 left-0 p-8 w-full transform translate-y-4 group-hover:translate-y-0 transition-transform">
|
||||
<span className="text-primary font-bold text-sm uppercase tracking-wider mb-2 block"><T>{project.cat}</T></span>
|
||||
<h3 className="text-2xl font-bold font-headline text-white mb-2"><T>{project.title}</T></h3>
|
||||
<span className="text-primary font-bold text-sm uppercase tracking-wider mb-2 block">{project.cat}</span>
|
||||
<h3 className="text-2xl font-bold font-headline text-white mb-2">{project.title}</h3>
|
||||
<div className="h-0 group-hover:h-auto overflow-hidden transition-all">
|
||||
<span className="text-white/80 text-sm flex items-center gap-2 mt-4">
|
||||
<T>Ver detalhes</T> <i className="ri-arrow-right-line"></i>
|
||||
Ver detalhes <i className="ri-arrow-right-line"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user