Skip to content

Commit 43d4d3c

Browse files
committed
clean up, rules of hook, no conditional hooks
1 parent dc8f3d5 commit 43d4d3c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ function WebsiteMapPage() {
5050
const { id } = useParams<{ id: string }>();
5151
const [mode, setMode] = useState<"total" | "perCapita">("total");
5252

53-
if (!id) {
54-
return <div>No website ID</div>;
55-
}
56-
57-
const { results, isLoading, getDataForQuery } = useMapLocationData(id, {
53+
const { isLoading, getDataForQuery } = useMapLocationData(id, {
5854
start_date: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
5955
end_date: new Date().toISOString().split('T')[0],
6056
granularity: 'daily'
6157
});
6258

59+
if (!id) {
60+
return <div>No website ID</div>;
61+
}
62+
6363
const locationData: LocationData = {
6464
countries: (getDataForQuery("map-countries", "country") || []).map((item: { name: string; visitors: number; pageviews: number; country_code?: string; country_name?: string }) => ({
6565
country: item.country_name || item.name,

apps/dashboard/components/analytics/data-table.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ import {
1616
Search,
1717
X,
1818
} from "lucide-react";
19-
import React, { Fragment, useCallback, useMemo, useRef, useState, useEffect } from "react";
19+
import React, { Fragment, useCallback, useRef, useState, useEffect } from "react";
2020
import ReactDOM from "react-dom";
21-
import { Card, CardContent, CardHeader } from "@/components/ui/card";
2221
import { Input } from "@/components/ui/input";
2322
import { Skeleton } from "@/components/ui/skeleton";
2423
import {

0 commit comments

Comments
 (0)