/* global React */
const { useState: uS, useMemo: uM } = React;
const { Icon, Avatar, Selo, ClassifPill, Sparkline, Radar, Trail, BarRow, MapCS,
TalentCard, TalentDetail, ProjectCard, OpCard, MatchCard, NetworkGraph, shade } = window;
// ============ DASHBOARD (Comitê) ============
function DashboardView({state, setState, onSelectTalento, onSelectProjeto}) {
const [heatmap, setHeatmap] = uS('talentos');
const [focusedMun, setFocusedMun] = uS(null);
const totals = uM(() => {
const t = window.TALENTOS, p = window.PROJETOS_INOV, o = window.OPORTUNIDADES;
return {
talentos: t.length, projetos: p.length,
mentores: window.MENTORES.length, eventos: o.length,
mei: t.length * 1.4 | 0,
conexoes: window.CONEXOES.length,
};
}, []);
// List ordered by heatmap
const cityList = uM(() => {
const data = window.densidadePorMunicipio(heatmap);
return window.MUNICIPALITIES
.map(m => ({ ...m, count: data[m.id] || 0 }))
.sort((a, b) => b.count - a.count);
}, [heatmap]);
const maxCity = cityList[0]?.count || 1;
return
{/* Hero KPIs */}
Talentos cadastrados
{totals.talentos}
+18 nos últimos 30 dias
Projetos / startups
{totals.projetos}
+3 este trimestre
Mentores ativos
{totals.mentores}
74 mentorias ativas
Conexões geradas
{totals.conexoes}
7 matches semana
Oportunidades abertas
{totals.eventos}
Hackathon em 32 dias
{/* Map dual view */}
{[{k:'talentos',l:'Calor de talentos'},{k:'projetos',l:'Calor de projetos'},
{k:'eventos',l:'Calor de eventos'},{k:'mr',l:'Microrregiões'}].map(t => (
setHeatmap(t.k)}>{t.l}
))}
{heatmap==='mr' ? 'Microrregiões' : 'Densidade'}
{heatmap==='mr' ? Object.entries(window.MR_NAMES).map(([k,n]) => (
{n}
)) : <>
Sem registro
Baixa
Média
Alta
>}
Ranking por município
{({talentos:'Talentos cadastrados',projetos:'Projetos ativos',
eventos:'Eventos realizados',mr:'Por microrregião'})[heatmap]}
{cityList.map(m => (
setFocusedMun(m.id)}>
{m.mr}
{m.nome}{m.isPolo && ' ●'}
{(m.pop/1000).toFixed(1)}k hab · IDH {m.idh.toFixed(2)}
{m.count}
))}
{/* Match feed + sidebar */}
Sugestões de match — esta semana
Geradas pela plataforma · 7 novas
{window.MATCHES.slice(0,5).map((m, i) => )}
Distribuição por setor
Projetos ativos por área de inovação
{(() => {
const counts = {};
window.PROJETOS_INOV.forEach(p => counts[p.setor] = (counts[p.setor]||0)+1);
const max = Math.max(...Object.values(counts));
return window.SETORES_INOV.filter(s => counts[s.id])
.sort((a,b) => counts[b.id] - counts[a.id])
.map(s =>
);
})()}
Próximos eventos
3 nos próximos 60 dias
Ver todos →
{window.OPORTUNIDADES.slice(0,3).map(o => (
{o.nome}
{o.data} · {o.cidade}
{o.tipo}
))}
Top talentos da semana
Maior pontuação ganha
{window.TALENTOS.slice().sort((a,b)=>b.pontos-a.pontos).slice(0,4).map((t,i) => (
onSelectTalento(t.id)}
style={{display:'flex', alignItems:'center', gap:10, padding:'8px 0',
borderBottom: i<3 ? '1px solid #F1F5F9' : 0, cursor:'pointer'}}>
{i+1}
{t.nome}
{t.cidade} · {t.curso}
{t.pontos}
))}
;
}
window.DashboardView = DashboardView;
// ============ TALENTOS ============
function TalentosView({onSelectTalento}) {
const [filtro, setFiltro] = uS('todos');
const [setor, setSetor] = uS(null);
const filtered = uM(() => {
let ts = window.TALENTOS;
if (filtro !== 'todos') ts = ts.filter(t => t.classificacao === filtro);
if (setor) ts = ts.filter(t => t.interesses.includes(setor));
return ts;
}, [filtro, setor]);
return
Talentos
{filtered.length} talentos cadastrados na rede regional
setFiltro('todos')}>
Todos {window.TALENTOS.length}
{window.CLASSIFICACOES.map(c => {
const n = window.TALENTOS.filter(t => t.classificacao === c.id).length;
return setFiltro(c.id)}>
{c.nome} {n}
;
})}
setSetor(null)}>
Todos os setores
{window.SETORES_INOV.map(s => (
setSetor(setor===s.id ? null : s.id)}>
{s.nome}
))}
{filtered.map(t => onSelectTalento(t.id)}/>)}
;
}
window.TalentosView = TalentosView;
// ============ PROJETOS ============
function ProjetosView({onSelectProjeto}) {
return
Projetos & Startups
{window.PROJETOS_INOV.length} iniciativas em desenvolvimento no Centro-Sul
{window.PROJETOS_INOV.map(p =>
onSelectProjeto(p.id)}/>)}
;
}
window.ProjetosView = ProjetosView;
// ============ REDE ============
function RedeView({onSelectTalento, onSelectProjeto}) {
const [focused, setFocused] = uS(null);
const handleSelect = (id) => {
setFocused(id);
if (id.startsWith('t')) onSelectTalento(id);
else if (id.startsWith('p')) onSelectProjeto(id);
};
return
Rede de inovação
Visualização de conexões entre talentos, projetos, mentores e empresas
Top mentores por mentorias ativas
Ver todos →
{window.MENTORES.slice().sort((a,b)=>b.mentorados-a.mentorados).slice(0,5).map(m => (
{m.nome}
{m.org} · {m.cidade}
{m.mentorados}
mentorados
))}
Empresas com demandas ativas
{window.EMPRESAS.map(e => (
))}
;
}
window.RedeView = RedeView;
// ============ OPORTUNIDADES ============
function OportunidadesView({onSelect}) {
return
Oportunidades
Editais, hackathons, programas e eventos abertos
{window.OPORTUNIDADES.map(o => onSelect && onSelect(o)}/>)}
;
}
window.OportunidadesView = OportunidadesView;
// ============ MEU PERFIL (Talento) ============
function MeuPerfilView({talentoId, onOpenProjeto}) {
const t = window.findTalento(talentoId || 't2');
if (!t) return null;
const setor = window.SETORES_INOV.find(s => s.id === t.interesses[0]);
const projeto = t.projetoAtivo ? window.findProjeto(t.projetoAtivo) : null;
return
{t.mr} · {t.cidade}
{window.CLASSIFICACOES.find(c=>c.id===t.classificacao)?.nome}
{t.nome}
{t.curso} · {t.instituicao}
Pontos de evolução
{t.pontos}
{(() => {
const next = window.CLASSIFICACOES.find(c => t.pontos < c.faixa[0]);
return next ? `${next.faixa[0] - t.pontos} pts para ${next.nome}` : 'Nível máximo!';
})()}
Sua trilha de evolução
Cada selo conquistado adiciona pontos
Sugestões para você
Oportunidades e conexões personalizadas
{window.MATCHES.filter(m => m.b === t.id || m.a === t.id).slice(0,3).map((m, i) => (
))}
{window.OPORTUNIDADES.slice(0,2).map(o => (
Oportunidade aberta
{o.nome}
{o.descricao}
{o.data} · {o.premio}
))}
{t.historico.map((h, i) => (
{h.tipo}
{h.titulo}
{h.resultado}
{h.ano} · +{h.pontos}
))}
{t.habilidades.map(h => {h})}
{projeto && (
onOpenProjeto(projeto.id)}>
{projeto.nome.slice(0,2).toUpperCase()}
{projeto.nome}
{projeto.fase}
)}
;
}
window.MeuPerfilView = MeuPerfilView;
// ============ EMPRESA / INSTITUIÇÃO / MENTOR (lighter views, role-specific) ============
function EmpresaView({onSelectTalento}) {
return
Buscar talentos
Encontre profissionais e projetos para sua empresa
Matches sugeridos para sua empresa
{window.MATCHES.filter(m => m.tipo==='empresa-talento' || m.tipo==='projeto-talento').slice(0,4).map((m,i) =>
)}
Estagiário de processos
14 candidaturas · publicada 8 dias
Designer industrial
6 candidaturas · publicada 3 dias
{window.TALENTOS.slice(0,5).map(t => (
onSelectTalento(t.id)}
style={{display:'flex', alignItems:'center', gap:10, padding:'8px 0', cursor:'pointer'}}>
))}
;
}
window.EmpresaView = EmpresaView;