🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Remove unused FilterOptions constants and update FilterComponent to include icons for better UI representation. Change default tab in Devices component from "devices" to "browsers" for improved user experience.
Bill Yang71d35a93d4d2
diff --git a/client/src/app/[site]/components/shared/Filters/FilterComponent.tsx b/client/src/app/[site]/components/shared/Filters/FilterComponent.tsxindex 9e71b7509..708d9f20f 100644--- a/client/src/app/[site]/components/shared/Filters/FilterComponent.tsx+++ b/client/src/app/[site]/components/shared/Filters/FilterComponent.tsx@@ -46,7 +46,10 @@ export function FilterComponent({<SelectContent>{FilterOptions.map((option) => (<SelectItem key={option.value} value={option.value}>- {option.label}+ <div className="flex items-center gap-2">+ {option.icon}+ {option.label}+ </div></SelectItem>))}</SelectContent>diff --git a/client/src/app/[site]/components/shared/Filters/const.ts b/client/src/app/[site]/components/shared/Filters/const.tsxsimilarity index 50%rename from client/src/app/[site]/components/shared/Filters/const.tsrename to client/src/app/[site]/components/shared/Filters/const.tsxindex ee49de4e7..b66e7793d 100644--- a/client/src/app/[site]/components/shared/Filters/const.ts+++ b/client/src/app/[site]/components/shared/Filters/const.tsx@@ -1,69 +1,117 @@+import React from "react";import { FilterParameter } from "../../../../../lib/store";+import {+ Globe,+ Map,+ FileText,+ Search,+ ArrowUpRight,+ Radio,+ Flag,+ MapPin,+ Building,+ Smartphone,+ Laptop,+ Chrome,+ Languages,+ LogIn,+ LogOut,+ Maximize,+ Zap,+ MapPinHouse,+ MapPinned,+ Share2,+ TabletSmartphone,+ MousePointerClick,+ FolderInput,+ AppWindow,+ Brain,+} from "lucide-react";-export const FilterOptions: { label: string; value: FilterParameter }[] = [+export const FilterOptions: {+ label: string;+ value: FilterParameter;+ icon: React.ReactNode;+}[] = [{label: "Path",value: "pathname",+ icon: <FolderInput className="h-4 w-4" />,},{label: "Page Title",value: "page_title",+ icon: <FileText className="h-4 w-4" />,},{label: "Query",value: "querystring",+ icon: <Search className="h-4 w-4" />,+ },+ {+ label: "Event Name",+ value: "event_name",+ icon: <MousePointerClick className="h-4 w-4" />,},{label: "Referrer",value: "referrer",+ icon: <Share2 className="h-4 w-4" />,},{label: "Channel",value: "channel",+ icon: <Radio className="h-4 w-4" />,+ },+ {+ label: "Entry Page",+ value: "entry_page",+ icon: <LogIn className="h-4 w-4" />,+ },+ {+ label: "Exit Page",+ value: "exit_page",+ icon: <LogOut className="h-4 w-4" />,},{label: "Country",value: "country",+ icon: <Globe className="h-4 w-4" />,},{label: "Region",value: "iso_3166_2",+ icon: <MapPinned className="h-4 w-4" />,},{label: "City",value: "city",+ icon: <MapPinHouse className="h-4 w-4" />,},{label: "Device Type",value: "device_type",+ icon: <TabletSmartphone className="h-4 w-4" />,},{label: "Operating System",value: "operating_system",+ icon: <Brain className="h-4 w-4" />,},{label: "Browser",value: "browser",+ icon: <AppWindow className="h-4 w-4" />,},{label: "Language",value: "language",- },- {- label: "Entry Page",- value: "entry_page",- },- {- label: "Exit Page",- value: "exit_page",+ icon: <Languages className="h-4 w-4" />,},{label: "Screen Dimensions",value: "dimensions",- },- {- label: "Event Name",- value: "event_name",+ icon: <Maximize className="h-4 w-4" />,},];diff --git a/client/src/app/[site]/main/components/sections/Devices.tsx b/client/src/app/[site]/main/components/sections/Devices.tsxindex 9a6cac1c9..46a85fb4b 100644--- a/client/src/app/[site]/main/components/sections/Devices.tsx+++ b/client/src/app/[site]/main/components/sections/Devices.tsx@@ -16,18 +16,18 @@ import { OperatingSystem } from "../../../components/shared/icons/OperatingSystetype Tab = "devices" | "browsers" | "os" | "dimensions";export function Devices() {- const [tab, setTab] = useState<Tab>("devices");+ const [tab, setTab] = useState<Tab>("browsers");return (<Card className="h-[445px]"><CardContent className="mt-2"><Tabs- defaultValue="devices"+ defaultValue="browsers"value={tab}onValueChange={(value) => setTab(value as Tab)}><TabsList>- <TabsTrigger value="devices">Devices</TabsTrigger><TabsTrigger value="browsers">Browsers</TabsTrigger>+ <TabsTrigger value="devices">Devices</TabsTrigger><TabsTrigger value="os">Operating Systems</TabsTrigger><TabsTrigger value="dimensions">Screen Dimensions</TabsTrigger></TabsList>