File size: 11,295 Bytes
66dd59b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
import React, { useState, useEffect } from 'react';
import './App.css';

// Componente principal da aplicação React
function App() {
  const [currentSection, setCurrentSection] = useState('home');
  const [isVisible, setIsVisible] = useState(false);

  useEffect(() => {
    // Animação de entrada
    setTimeout(() => setIsVisible(true), 100);

    // Detectar seção atual baseada na URL
    const path = window.location.pathname;
    if (path.includes('servicos')) setCurrentSection('services');
    else if (path.includes('projetos')) setCurrentSection('projects');
    else if (path.includes('sobre')) setCurrentSection('about');
    else if (path.includes('contato')) setCurrentSection('contact');
    else setCurrentSection('home');
  }, []);

  return (
    <div className={`react-app ${isVisible ? 'visible' : ''}`}>

      <div className="react-container">

        <div className="react-header">

          <h3>🚀 SoftEdge Corporation - React Integration</h3>

          <p>Componentes React integrados com PHP</p>

        </div>



        <div className="react-content">

          <Navigation currentSection={currentSection} onNavigate={setCurrentSection} />

          <ContentSection section={currentSection} />

        </div>



        <div className="react-footer">

          <p>React + PHP = 💪 Potência Total</p>

        </div>

      </div>

    </div>
  );
}

// Componente de navegação
function Navigation({ currentSection, onNavigate }) {
  const sections = [
    { id: 'home', label: 'Início', icon: '🏠' },
    { id: 'services', label: 'Serviços', icon: '⚙️' },
    { id: 'projects', label: 'Projetos', icon: '📁' },
    { id: 'about', label: 'Sobre', icon: '👥' },
    { id: 'contact', label: 'Contato', icon: '📧' }
  ];

  return (
    <nav className="react-nav">

      {sections.map(section => (

        <button

          key={section.id}

          className={`nav-item ${currentSection === section.id ? 'active' : ''}`}

          onClick={() => onNavigate(section.id)}

        >

          <span className="nav-icon">{section.icon}</span>

          <span className="nav-label">{section.label}</span>

        </button>

      ))}

    </nav>
  );
}

// Componente de conteúdo dinâmico
function ContentSection({ section }) {
  const [stats, setStats] = useState(null);
  const [loading, setLoading] = useState(false);

  useEffect(() => {
    if (section === 'stats') {
      fetchStats();
    }
  }, [section]);

  const fetchStats = async () => {
    setLoading(true);
    try {
      // Simular chamada para API PHP
      const response = await fetch('/api.php?r=stats');
      const data = await response.json();
      setStats(data);
    } catch (error) {
      console.error('Erro ao buscar estatísticas:', error);
      // Dados mock para demonstração
      setStats({
        projects: 70,
        satisfaction: 4.9,
        support: '24/7',
        codeQuality: '100%'
      });
    }
    setLoading(false);
  };

  const renderContent = () => {
    switch (section) {
      case 'home':
        return (
          <div className="content-section">

            <h2>Bem-vindo à SoftEdge Corporation</h2>

            <p>Transformamos ideias em soluções digitais de excelência.</p>

            <div className="feature-grid">

              <div className="feature-card">

                <div className="feature-icon">🚀</div>

                <h3>Desenvolvimento Full Stack</h3>

                <p>Tecnologias modernas para aplicações completas</p>

              </div>

              <div className="feature-card">

                <div className="feature-icon">🤖</div>

                <h3>IA & Automação</h3>

                <p>Inteligência artificial para otimizar processos</p>

              </div>

              <div className="feature-card">

                <div className="feature-icon"></div>

                <h3>Performance</h3>

                <p>Otimização e consultoria especializada</p>

              </div>

            </div>

          </div>
        );

      case 'services':
        return (
          <div className="content-section">

            <h2>Nossos Serviços</h2>

            <div className="services-grid">

              <ServiceCard

                icon="💻"

                title="Desenvolvimento Web"

                description="Aplicações web modernas com React, Next.js e PHP"

                technologies={['React', 'Next.js', 'PHP', 'MySQL']}

              />

              <ServiceCard

                icon="📱"

                title="Aplicativos Mobile"

                description="Apps nativos e multiplataforma"

                technologies={['Flutter', 'React Native', 'Firebase']}

              />

              <ServiceCard

                icon="🧠"

                title="Inteligência Artificial"

                description="Soluções de IA personalizadas"

                technologies={['Python', 'TensorFlow', 'OpenAI']}

              />

              <ServiceCard

                icon="☁️"

                title="Cloud & DevOps"

                description="Deploy e infraestrutura escalável"

                technologies={['Docker', 'AWS', 'Railway', 'Render']}

              />

            </div>

          </div>
        );

      case 'projects':
        return (
          <div className="content-section">

            <h2>Projetos em Destaque</h2>

            <div className="projects-grid">

              <ProjectCard

                title="AKIRA IA"

                description="Assistente virtual angolano com processamento de linguagem natural"

                status="Concluído"

                technologies={['Python', 'TensorFlow', 'FastAPI']}

              />

              <ProjectCard

                title="ERP Gestão Total"

                description="Sistema completo de gestão empresarial"

                status="Concluído"

                technologies={['Laravel', 'Vue.js', 'MySQL']}

              />

              <ProjectCard

                title="E-commerce ShopFast"

                description="Plataforma de vendas online de alta performance"

                status="Concluído"

                technologies={['Next.js', 'Stripe', 'Prisma']}

              />

            </div>

          </div>
        );

      case 'about':
        return (
          <div className="content-section">

            <h2>Sobre a SoftEdge</h2>

            <div className="about-content">

              <div className="team-section">

                <h3>Nossa Equipe</h3>

                <div className="team-members">

                  <TeamMember name="Isaac Quarenta" role="CEO & Fundador" />

                  <TeamMember name="José Lopes" role="CTO" />

                  <TeamMember name="Stefânio Costa" role="Desenvolvedor Senior" />

                  <TeamMember name="Tiago Rodrigues" role="Designer & UX" />

                </div>

              </div>

              <div className="mission-section">

                <h3>Nossa Missão</h3>

                <p>Transformar ideias em soluções tecnológicas que fazem a diferença no mundo digital.</p>

              </div>

            </div>

          </div>
        );

      case 'contact':
        return (
          <div className="content-section">

            <h2>Entre em Contato</h2>

            <ContactForm />

          </div>
        );

      default:
        return (
          <div className="content-section">

            <h2>Seção não encontrada</h2>

            <p>Selecione uma seção no menu de navegação.</p>

          </div>
        );
    }
  };

  return (
    <div className="content-container">

      {renderContent()}

    </div>
  );
}

// Componentes auxiliares
function ServiceCard({ icon, title, description, technologies }) {
  return (
    <div className="service-card">

      <div className="service-icon">{icon}</div>

      <h3>{title}</h3>

      <p>{description}</p>

      <div className="tech-stack">

        {technologies.map(tech => (

          <span key={tech} className="tech-tag">{tech}</span>

        ))}

      </div>

    </div>
  );
}

function ProjectCard({ title, description, status, technologies }) {
  return (
    <div className="project-card">

      <div className="project-header">

        <h3>{title}</h3>

        <span className={`status ${status.toLowerCase()}`}>{status}</span>

      </div>

      <p>{description}</p>

      <div className="tech-stack">

        {technologies.map(tech => (

          <span key={tech} className="tech-tag">{tech}</span>

        ))}

      </div>

    </div>
  );
}

function TeamMember({ name, role }) {
  return (
    <div className="team-member">

      <div className="member-avatar">

        <span>{name.charAt(0)}</span>

      </div>

      <div className="member-info">

        <h4>{name}</h4>

        <p>{role}</p>

      </div>

    </div>
  );
}

function ContactForm() {
  const [formData, setFormData] = useState({
    name: '',
    email: '',
    message: ''
  });
  const [submitted, setSubmitted] = useState(false);

  const handleSubmit = async (e) => {
    e.preventDefault();
    try {
      const response = await fetch('/api.php?r=contact', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        body: JSON.stringify(formData)
      });

      if (response.ok) {
        setSubmitted(true);
        setFormData({ name: '', email: '', message: '' });
      }
    } catch (error) {
      console.error('Erro ao enviar formulário:', error);
    }
  };

  const handleChange = (e) => {
    setFormData({
      ...formData,
      [e.target.name]: e.target.value
    });
  };

  if (submitted) {
    return (
      <div className="success-message">

        <h3>✅ Mensagem enviada com sucesso!</h3>

        <p>Entraremos em contato em breve.</p>

        <button onClick={() => setSubmitted(false)}>Enviar outra mensagem</button>

      </div>
    );
  }

  return (
    <form className="contact-form" onSubmit={handleSubmit}>

      <div className="form-group">

        <label htmlFor="name">Nome</label>

        <input

          type="text"

          id="name"

          name="name"

          value={formData.name}

          onChange={handleChange}

          required

        />

      </div>



      <div className="form-group">

        <label htmlFor="email">Email</label>

        <input

          type="email"

          id="email"

          name="email"

          value={formData.email}

          onChange={handleChange}

          required

        />

      </div>



      <div className="form-group">

        <label htmlFor="message">Mensagem</label>

        <textarea

          id="message"

          name="message"

          value={formData.message}

          onChange={handleChange}

          rows="5"

          required

        />

      </div>



      <button type="submit" className="submit-btn">Enviar Mensagem</button>

    </form>
  );
}

export default App;