diff --git a/frontend/src/components/ConsultorCard.jsx b/frontend/src/components/ConsultorCard.jsx index 05cbc54..2c3506e 100644 --- a/frontend/src/components/ConsultorCard.jsx +++ b/frontend/src/components/ConsultorCard.jsx @@ -1,8 +1,17 @@ -import React, { useState } from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import './ConsultorCard.css'; const ConsultorCard = ({ consultor, highlight }) => { const [expanded, setExpanded] = useState(false); + const cardRef = useRef(null); + + useEffect(() => { + if (highlight && cardRef.current) { + setTimeout(() => { + cardRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }, 100); + } + }, [highlight]); const getRankClass = (rank) => { if (rank === 1) return 'rank-1'; @@ -20,7 +29,7 @@ const ConsultorCard = ({ consultor, highlight }) => { const { consultoria } = consultor; return ( -