mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Convert realtime components to TS.
This commit is contained in:
parent
e67282d7d8
commit
8d31f43f0f
12 changed files with 75 additions and 51 deletions
|
|
@ -3,6 +3,7 @@ import { format, startOfMinute, subMinutes, isBefore } from 'date-fns';
|
|||
import PageviewsChart from './PageviewsChart';
|
||||
import { getDateArray } from 'lib/date';
|
||||
import { DEFAULT_ANIMATION_DURATION, REALTIME_RANGE } from 'lib/constants';
|
||||
import { RealtimeData } from 'lib/types';
|
||||
|
||||
function mapData(data: any[]) {
|
||||
let last = 0;
|
||||
|
|
@ -24,11 +25,9 @@ function mapData(data: any[]) {
|
|||
}
|
||||
|
||||
export interface RealtimeChartProps {
|
||||
data: {
|
||||
pageviews: any[];
|
||||
visitors: any[];
|
||||
};
|
||||
data: RealtimeData;
|
||||
unit: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function RealtimeChart({ data, unit, ...props }: RealtimeChartProps) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue