init
This commit is contained in:
@@ -16,9 +16,10 @@ type GcbPoint = { distanceKm: number; left: number; right: number };
|
||||
|
||||
type Props = {
|
||||
data: GcbPoint[];
|
||||
syncId?: string;
|
||||
};
|
||||
|
||||
export function GcbChart({ data }: Props) {
|
||||
export function GcbChart({ data, syncId }: Props) {
|
||||
const uid = useId();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
useEffect(() => setMounted(true), []);
|
||||
@@ -41,7 +42,7 @@ export function GcbChart({ data }: Props) {
|
||||
</span>
|
||||
</div>
|
||||
<ResponsiveContainer width="100%" height={120}>
|
||||
<AreaChart data={data} margin={{ top: 4, right: 8, left: 0, bottom: 0 }}>
|
||||
<AreaChart syncId={syncId} data={data} margin={{ top: 4, right: 8, left: 0, bottom: 0 }}>
|
||||
<defs>
|
||||
<linearGradient id={`gcb-l-${uid}`} x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="5%" stopColor="var(--color-accent)" stopOpacity={0.2} />
|
||||
|
||||
Reference in New Issue
Block a user