Skip to content

Commit 8e4dd47

Browse files
committed
chore: clean up map page, update icons
1 parent 43d4d3c commit 8e4dd47

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { AlertCircle, Globe, HelpCircle, MapPin } from "lucide-react";
3+
import { GlobeIcon, MapPinIcon, QuestionIcon } from "@phosphor-icons/react";
44
import dynamic from "next/dynamic";
55
import { useParams } from "next/navigation";
66
import { Suspense, useState } from "react";
@@ -11,6 +11,7 @@ import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
1111
import { useMapLocationData } from "@/hooks/use-dynamic-query";
1212
import { cn } from "@/lib/utils";
1313
import { WebsitePageHeader } from "../_components/website-page-header";
14+
import { CountryFlag } from "@/components/analytics/icons/CountryFlag";
1415

1516
interface CountryData {
1617
country: string;
@@ -86,7 +87,7 @@ function WebsiteMapPage() {
8687
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
8788
<WebsitePageHeader
8889
title="Geographic Data"
89-
icon={<Globe className="h-5 w-5 text-primary" />}
90+
icon={<GlobeIcon className="h-5 w-5 text-primary" weight="duotone" aria-label="Globe" />}
9091
websiteId={id}
9192
variant="minimal"
9293
subtitle={!isLoading && totalVisitors > 0 ? `${totalVisitors.toLocaleString()} visitors across ${topCountries.length} countries` : undefined}
@@ -124,7 +125,7 @@ function WebsiteMapPage() {
124125
<CardHeader className="flex-shrink-0 pb-3">
125126
<CardTitle className="flex items-center justify-between">
126127
<span className="flex items-center gap-2">
127-
<MapPin className="h-4 w-4" />
128+
<MapPinIcon className="h-4 w-4" weight="duotone" aria-label="World Map" />
128129
World Map
129130
</span>
130131
<Badge className="text-xs" variant="secondary">
@@ -145,7 +146,7 @@ function WebsiteMapPage() {
145146
<Card className="flex min-h-0 flex-1 flex-col overflow-hidden rounded md:w-72 md:flex-none">
146147
<CardHeader className="flex-shrink-0 pb-3">
147148
<CardTitle className="flex items-center gap-2">
148-
<Globe className="h-4 w-4" />
149+
<GlobeIcon className="h-4 w-4" weight="duotone" aria-label="Top Countries" />
149150
Top Countries
150151
</CardTitle>
151152
</CardHeader>
@@ -220,7 +221,7 @@ function WebsiteMapPage() {
220221
<div className="flex items-center justify-between p-3">
221222
<div className="flex min-w-0 flex-1 items-center gap-3">
222223
<div className="flex h-4 w-6 flex-shrink-0 items-center justify-center rounded bg-muted">
223-
<HelpCircle className="h-3 w-3 text-muted-foreground" />
224+
<QuestionIcon className="h-3 w-3 text-muted-foreground" weight="duotone" aria-label="Unknown" />
224225
</div>
225226
<div className="min-w-0 flex-1">
226227
<div className="font-medium text-sm">Unknown</div>
@@ -244,7 +245,7 @@ function WebsiteMapPage() {
244245
<div className="flex flex-col items-center justify-center py-16 text-center">
245246
<div className="mb-4">
246247
<div className="mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-2xl bg-muted/20">
247-
<Globe className="h-7 w-7 text-muted-foreground/50" />
248+
<GlobeIcon className="h-7 w-7 text-muted-foreground/50" weight="duotone" aria-label="No Data" />
248249
</div>
249250
</div>
250251
<h4 className="mb-2 font-medium text-base text-foreground">

apps/dashboard/components/analytics/map-component.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,14 @@ export function MapComponent({
230230
return (
231231
<div
232232
className="relative"
233+
onMouseMove={(e) => {
234+
if (tooltipContent) {
235+
setTooltipPosition({
236+
x: e.clientX,
237+
y: e.clientY,
238+
});
239+
}
240+
}}
233241
ref={containerRef}
234242
style={{ height }}
235243
>
@@ -272,20 +280,13 @@ export function MapComponent({
272280

273281
{tooltipContent && (
274282
<div
275-
role="tooltip"
276283
className="pointer-events-none fixed z-50 rounded-lg border border-gray-200 bg-white p-3 text-gray-900 text-sm shadow-xl backdrop-blur-sm dark:border-gray-700 dark:bg-gray-900 dark:text-white"
277284
style={{
278285
left: tooltipPosition.x,
279286
top: tooltipPosition.y - 10,
280287
transform: "translate(-50%, -100%)",
281288
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
282289
}}
283-
onMouseMove={(e) => {
284-
setTooltipPosition({
285-
x: e.clientX,
286-
y: e.clientY,
287-
});
288-
}}
289290
>
290291
<div className="mb-1 flex items-center gap-2 font-medium">
291292
{tooltipContent.code && <CountryFlag country={tooltipContent.code.slice(0, 2)} />}

0 commit comments

Comments
 (0)