diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx
index 229ca28..a076ca6 100644
--- a/src/pages/Dashboard.tsx
+++ b/src/pages/Dashboard.tsx
@@ -11,6 +11,19 @@ const COLORS = [
'#06b6d4', '#ec4899', '#eab308', '#6366f1', '#14b8a6'
];
+const CustomTooltip = ({ active, payload, label }: any) => {
+ if (active && payload && payload.length) {
+ const color = payload[0].payload?.fill || payload[0].color || '#9ECAE1';
+ return (
+
+
{label}
+
Vendas: {payload[0].value}
+
+ );
+ }
+ return null;
+};
+
const Dashboard = () => {
const { dateRange, setDateRange, ordersData } = useOutletContext<{ dateRange: DateRange, setDateRange: (range: DateRange) => void, ordersData: OrderData[] }>();
@@ -101,7 +114,7 @@ const Dashboard = () => {
Produtos Mais Vendidos
-
+
@@ -113,14 +126,7 @@ const Dashboard = () => {
height={120}
/>
-
+ } cursor={{ fill: '#222222' }} />
{salesByProduct.map((_, index) => (
|
diff --git a/src/pages/ProductDetails.tsx b/src/pages/ProductDetails.tsx
index 5d524c4..41ad920 100644
--- a/src/pages/ProductDetails.tsx
+++ b/src/pages/ProductDetails.tsx
@@ -6,6 +6,18 @@ import DateRangePicker from '../components/DateRangePicker';
import type { OrderData, DateRange } from '../types';
import { parseOrderDate } from '../dataService';
+const CustomTooltip = ({ active, payload, label }: any) => {
+ if (active && payload && payload.length) {
+ return (
+
+
{label}
+
Vendas: {payload[0].value}
+
+ );
+ }
+ return null;
+};
+
const ProductDetails = () => {
const { id } = useParams<{ id: string }>();
const { dateRange, setDateRange, ordersData } = useOutletContext<{ dateRange: DateRange, setDateRange: (range: DateRange) => void, ordersData: OrderData[] }>();
@@ -106,7 +118,7 @@ const ProductDetails = () => {
Volume de Vendas por Data
-
+
@@ -118,13 +130,7 @@ const ProductDetails = () => {
height={80}
/>
-
+ } cursor={{ fill: '#222222' }} />