2021-02-27 22:03:51 +03:00
|
|
|
import { RouteComponentProps } from 'react-router';
|
|
|
|
import { boundToMercureHub } from '../mercure/helpers/boundToMercureHub';
|
|
|
|
import { ShlinkVisitsParams } from '../api/types';
|
2021-02-28 12:12:30 +03:00
|
|
|
import { Topics } from '../mercure/helpers/Topics';
|
2021-02-27 22:03:51 +03:00
|
|
|
import { TagVisits as TagVisitsState } from './reducers/tagVisits';
|
|
|
|
import VisitsStats from './VisitsStats';
|
|
|
|
import { OrphanVisitsHeader } from './OrphanVisitsHeader';
|
|
|
|
|
|
|
|
export interface OrphanVisitsProps extends RouteComponentProps<{ tag: string }> {
|
|
|
|
getOrphanVisits: (params: ShlinkVisitsParams) => void;
|
|
|
|
orphanVisits: TagVisitsState;
|
|
|
|
cancelGetOrphanVisits: () => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const OrphanVisits = boundToMercureHub(({
|
|
|
|
history: { goBack },
|
|
|
|
match: { url },
|
|
|
|
getOrphanVisits,
|
|
|
|
orphanVisits,
|
|
|
|
cancelGetOrphanVisits,
|
|
|
|
}: OrphanVisitsProps) => (
|
|
|
|
<VisitsStats
|
|
|
|
getVisits={getOrphanVisits}
|
|
|
|
cancelGetVisits={cancelGetOrphanVisits}
|
|
|
|
visitsInfo={orphanVisits}
|
|
|
|
baseUrl={url}
|
|
|
|
>
|
|
|
|
<OrphanVisitsHeader orphanVisits={orphanVisits} goBack={goBack} />
|
|
|
|
</VisitsStats>
|
2021-02-28 12:12:30 +03:00
|
|
|
), () => [ Topics.orphanVisits() ]);
|