import React, { useMemo } from 'react';
import { ScatterChart, Scatter, XAxis, YAxis, Tooltip, ResponsiveContainer, ZAxis } from 'recharts';
import { SpotlightCard } from '../SpotlightCard';
import { InfoTooltip } from '../InfoTooltip';
const CustomTooltip = ({ active, payload }) => {
if (active && payload && payload.length) {
const data = payload[0].payload;
return (
{data.address}
Built: {data.year}
Value: ${data.value.toLocaleString()}
);
}
return null;
};
export const GoldenLeadsScatter = ({ properties }) => {
const data = useMemo(() => {
return properties.map(p => ({
x: p.propertyData.yearBuilt,
y: p.propertyData.currentEstimatedMarketValue,
z: 100, // bubble size
address: p.propertyData.propertyAddress.split(',')[0],
year: p.propertyData.yearBuilt,
value: p.propertyData.currentEstimatedMarketValue,
isGolden: p.propertyData.yearBuilt < 2000 && p.propertyData.currentEstimatedMarketValue > 400000
}));
}, [properties]);
return (
Golden Leads
High Value + Older Homes
Opportunity Zone
`${value / 1000}k`}
axisLine={false}
tickLine={false}
/>
} cursor={{ strokeDasharray: '3 3' }} />
);
};