shlink-web-client/src/visits/OrphanVisits.tsx

35 lines
1.1 KiB
TypeScript
Raw Normal View History

import { RouteComponentProps } from 'react-router';
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
import { ShlinkVisitsParams } from '../api/types';
import { Topics } from '../mercure/helpers/Topics';
2021-03-06 12:56:49 +03:00
import { Settings } from '../settings/reducers/settings';
import VisitsStats from './VisitsStats';
import { OrphanVisitsHeader } from './OrphanVisitsHeader';
2021-02-28 12:36:56 +03:00
import { VisitsInfo } from './types';
2021-02-28 12:36:56 +03:00
export interface OrphanVisitsProps extends RouteComponentProps {
getOrphanVisits: (params: ShlinkVisitsParams) => void;
2021-02-28 12:36:56 +03:00
orphanVisits: VisitsInfo;
cancelGetOrphanVisits: () => void;
2021-03-06 12:56:49 +03:00
settings: Settings;
}
export const OrphanVisits = boundToMercureHub(({
history: { goBack },
match: { url },
getOrphanVisits,
orphanVisits,
cancelGetOrphanVisits,
2021-03-06 12:56:49 +03:00
settings,
}: OrphanVisitsProps) => (
<VisitsStats
getVisits={getOrphanVisits}
cancelGetVisits={cancelGetOrphanVisits}
visitsInfo={orphanVisits}
baseUrl={url}
2021-03-06 12:56:49 +03:00
settings={settings}
>
<OrphanVisitsHeader orphanVisits={orphanVisits} goBack={goBack} />
</VisitsStats>
), () => [ Topics.orphanVisits() ]);