diff --git a/package-lock.json b/package-lock.json index 4b4d799..53ab696 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "date-fns": "^4.1.0", "embla-carousel-react": "^8.6.0", "framer-motion": "^12.23.26", + "html2canvas": "^1.4.1", "lucide-react": "^0.554.0", "react": "^19.2.0", "react-day-picker": "^9.11.1", @@ -3487,6 +3488,15 @@ "dev": true, "license": "MIT" }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/baseline-browser-mapping": { "version": "2.8.29", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.29.tgz", @@ -3728,6 +3738,15 @@ "node": ">= 8" } }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "license": "MIT", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", @@ -4692,6 +4711,19 @@ "hermes-estree": "0.25.1" } }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "license": "MIT", + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -5944,6 +5976,15 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "license": "MIT", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", @@ -6181,6 +6222,15 @@ } } }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "license": "MIT", + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, "node_modules/vaul": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vaul/-/vaul-1.1.2.tgz", diff --git a/package.json b/package.json index e4c523d..7b2f208 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "date-fns": "^4.1.0", "embla-carousel-react": "^8.6.0", "framer-motion": "^12.23.26", + "html2canvas": "^1.4.1", "lucide-react": "^0.554.0", "react": "^19.2.0", "react-day-picker": "^9.11.1", diff --git a/src/views/components/ProfileCard.jsx b/src/views/components/ProfileCard.jsx index 8497a18..e7447fc 100644 --- a/src/views/components/ProfileCard.jsx +++ b/src/views/components/ProfileCard.jsx @@ -1,4 +1,10 @@ -import React, { useCallback, useEffect, useMemo, useRef } from 'react'; +import React, { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; import './ProfileCard.css'; import logoImg from '@/assets/images/agape-logo.png'; @@ -39,7 +45,15 @@ const ProfileCardComponent = ({ contactText = 'Contact', showUserInfo = true, onContactClick, + // métricas para popular o cartão + totalAcessos = null, + aplicacoesCount = null, + topAppName = null, + topAppAcessos = null, + // permite mostrar/ocultar botões de compartilhamento + showShareButtons = true, }) => { + const [sharing, setSharing] = useState(false); const wrapRef = useRef(null); const shellRef = useRef(null); @@ -346,17 +360,23 @@ const ProfileCardComponent = ({ gap: '16px', padding: '24px', }}> - {/* Card de Acessos */} + {/* Card de Acessos (dinâmico) */}
Acessos
Aplicações
- Aplicação mais utilizada + {topAppAcessos != null + ? `${topAppAcessos.toLocaleString('pt-BR')} acessos` + : 'Aplicação mais utilizada'}
- Os sistemas que mais acessaram o portal -
{/* Lista de sistemas */} @@ -368,44 +362,12 @@ export function RetrospectiveSlides() { ); })} - - {/* Indicador de progresso */} -