Skip to content

Commit 81c2946

Browse files
committed
Refactor types on map page to a common file.
This helps in using them later from other places.
1 parent e60203d commit 81c2946

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

apps/dashboard/app/(main)/websites/[id]/map/page.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,9 @@ import { Skeleton } from '@/components/ui/skeleton';
1111
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
1212
import { useMapLocationData } from '@/hooks/use-dynamic-query';
1313
import { cn } from '@/lib/utils';
14+
import type { LocationData } from '@shared/types/website';
1415
import { WebsitePageHeader } from '../_components/website-page-header';
1516

16-
interface CountryData {
17-
country: string;
18-
country_code?: string;
19-
visitors: number;
20-
pageviews: number;
21-
}
22-
23-
interface RegionData {
24-
country: string;
25-
visitors: number;
26-
pageviews: number;
27-
}
28-
29-
interface LocationData {
30-
countries: CountryData[];
31-
regions: RegionData[];
32-
}
33-
3417
const MapComponent = dynamic(
3518
() =>
3619
import('@/components/analytics/map-component').then((mod) => ({

packages/shared/src/types/website.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,21 @@ export interface WebsitesApiResponse {
4646
data?: Website[];
4747
error?: string;
4848
}
49+
50+
export interface CountryData {
51+
country: string;
52+
country_code?: string;
53+
visitors: number;
54+
pageviews: number;
55+
}
56+
57+
export interface RegionData {
58+
country: string;
59+
visitors: number;
60+
pageviews: number;
61+
}
62+
63+
export interface LocationData {
64+
countries: CountryData[];
65+
regions: RegionData[];
66+
}

0 commit comments

Comments
 (0)