🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Refactor SessionCard and SessionDetails components for improved readability and consistency
Bill Yang0e5d4f444afa
diff --git a/client/src/components/Sessions/SessionCard.tsx b/client/src/components/Sessions/SessionCard.tsxindex 1e8ff7b04..14551bb1c 100644--- a/client/src/components/Sessions/SessionCard.tsx+++ b/client/src/components/Sessions/SessionCard.tsx@@ -1,17 +1,6 @@import { Skeleton } from "@/components/ui/skeleton";-import {- Tooltip,- TooltipContent,- TooltipTrigger,-} from "@/components/ui/tooltip";-import {- ArrowRight,- ChevronDown,- ChevronRight,- FileText,- MousePointerClick,- TriangleAlert,-} from "lucide-react";+import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";+import { ArrowRight, ChevronDown, ChevronRight, FileText, MousePointerClick, TriangleAlert } from "lucide-react";import { DateTime } from "luxon";import { memo, useState } from "react";import { GetSessionsResponse } from "../../api/analytics/userSessions";@@ -66,24 +55,15 @@ export function SessionCard({ session, onClick, userId }: SessionCardProps) {<div className="p-3 cursor-pointer" onClick={handleCardClick}><div className="flex items-center gap-2"><div className="hidden md:flex items-center gap-2">- <span className="text-xs font-mono text-gray-400">- {truncatedUserId}- </span>+ <span className="text-xs font-mono text-gray-400">{truncatedUserId}</span></div>{/* Icons section */}<div className="flex space-x-2 items-center md:ml-3">{session.country && (- <CountryFlagTooltipIcon- country={session.country}- city={session.city}- region={session.region}- />+ <CountryFlagTooltipIcon country={session.country} city={session.city} region={session.region} />)}- <BrowserTooltipIcon- browser={session.browser || "Unknown"}- browser_version={session.browser_version}- />+ <BrowserTooltipIcon browser={session.browser || "Unknown"} browser_version={session.browser_version} /><OperatingSystemTooltipIconoperating_system={session.operating_system || ""}operating_system_version={session.operating_system_version}@@ -95,10 +75,7 @@ export function SessionCard({ session, onClick, userId }: SessionCardProps) {/><Tooltip><TooltipTrigger asChild>- <Badge- variant="outline"- className="flex items-center gap-1 bg-neutral-800 text-gray-300"- >+ <Badge variant="outline" className="flex items-center gap-1 bg-neutral-800 text-gray-300"><FileText className="w-4 h-4 text-blue-500" /><span>{formatter(session.pageviews)}</span></Badge>@@ -107,10 +84,7 @@ export function SessionCard({ session, onClick, userId }: SessionCardProps) {</Tooltip><Tooltip><TooltipTrigger asChild>- <Badge- variant="outline"- className="flex items-center gap-1 bg-neutral-800 text-gray-300"- >+ <Badge variant="outline" className="flex items-center gap-1 bg-neutral-800 text-gray-300"><MousePointerClick className="w-4 h-4 text-amber-500" /><span>{formatter(session.events)}</span></Badge>@@ -119,10 +93,7 @@ export function SessionCard({ session, onClick, userId }: SessionCardProps) {</Tooltip><Tooltip><TooltipTrigger asChild>- <Badge- variant="outline"- className="flex items-center gap-1 bg-neutral-800 text-gray-300"- >+ <Badge variant="outline" className="flex items-center gap-1 bg-neutral-800 text-gray-300"><TriangleAlert className="w-4 h-4 text-red-500" /><span>{formatter(session.errors)}</span></Badge>@@ -192,17 +163,7 @@ export function SessionCard({ session, onClick, userId }: SessionCardProps) {export const SessionCardSkeleton = memo(() => {// Function to get a random width class for skeletonsconst getRandomWidth = () => {- const widths = [- "w-16",- "w-20",- "w-24",- "w-28",- "w-32",- "w-36",- "w-40",- "w-44",- "w-48",- ];+ const widths = ["w-16", "w-20", "w-24", "w-28", "w-32", "w-36", "w-40", "w-44", "w-48"];return widths[Math.floor(Math.random() * widths.length)];};@@ -220,10 +181,7 @@ export const SessionCardSkeleton = memo(() => {// Create multiple skeletons for a realistic loading stateconst skeletons = Array.from({ length: 10 }).map((_, index) => (- <div- className="mb-3 rounded-lg bg-neutral-900 border border-neutral-800 overflow-hidden"- key={index}- >+ <div className="mb-3 rounded-lg bg-neutral-900 border border-neutral-800 overflow-hidden" key={index}><div className="p-3"><div className="flex items-center gap-2">{/* Avatar and User ID */}@@ -237,10 +195,9 @@ export const SessionCardSkeleton = memo(() => {<Skeleton className="h-4 w-4 rounded-sm flex-shrink-0" /><Skeleton className="h-4 w-4 rounded-sm flex-shrink-0" /><Skeleton className="h-4 w-4 rounded-sm" />- {/* Badge skeleton for pageviews */}- <Skeleton className="h-[21px] w-8 rounded-sm" />- {/* Badge skeleton for events */}- <Skeleton className="h-[21px] w-8 rounded-sm" />+ <Skeleton className="h-[21px] w-12 rounded-sm" />+ <Skeleton className="h-[21px] w-12 rounded-sm" />+ <Skeleton className="h-[21px] w-12 rounded-sm" /></div>{/* Entry/Exit paths with randomized widths */}@@ -258,9 +215,7 @@ export const SessionCardSkeleton = memo(() => {<Skeleton className={cn("h-3", getRandomTimeWidth())} />{/* Duration skeleton */}- <Skeleton- className={cn("h-3", getRandomDurationWidth(), "hidden md:block")}- />+ <Skeleton className={cn("h-3", getRandomDurationWidth(), "hidden md:block")} /></div>{/* Expand icon */}diff --git a/client/src/components/Sessions/SessionDetails.tsx b/client/src/components/Sessions/SessionDetails.tsxindex b960bf2fb..a9cb9261e 100644--- a/client/src/components/Sessions/SessionDetails.tsx+++ b/client/src/components/Sessions/SessionDetails.tsx@@ -18,11 +18,7 @@ import { DateTime } from "luxon";import Link from "next/link";import { useParams } from "next/navigation";import { memo, useMemo } from "react";-import {- GetSessionsResponse,- SessionEvent,- useGetSessionDetailsInfinite,-} from "../../api/analytics/userSessions";+import { GetSessionsResponse, SessionEvent, useGetSessionDetailsInfinite } from "../../api/analytics/userSessions";import { Browser } from "../../app/[site]/components/shared/icons/Browser";import { CountryFlag } from "../../app/[site]/components/shared/icons/CountryFlag";import { OperatingSystem } from "../../app/[site]/components/shared/icons/OperatingSystem";@@ -55,9 +51,7 @@ function PageviewItem({let duration = null;if (isPageview && nextTimestamp) {const nextTime = DateTime.fromSQL(nextTimestamp, { zone: "utc" }).toLocal();- const totalSeconds = Math.floor(- nextTime.diff(timestamp).milliseconds / 1000- );+ const totalSeconds = Math.floor(nextTime.diff(timestamp).milliseconds / 1000);duration = formatDuration(totalSeconds);}@@ -79,8 +73,9 @@ function PageviewItem({"flex items-center justify-center w-8 h-8 rounded-full border",isEvent? "bg-amber-900/30 border-amber-500/50"- : (isError ? "bg-red-900/30 border-red-500/50"- : "bg-blue-900/30 border-blue-500/50")+ : isError+ ? "bg-red-900/30 border-red-500/50"+ : "bg-blue-900/30 border-blue-500/50")}><span className="text-sm font-medium">{index + 1}</span>@@ -92,19 +87,17 @@ function PageviewItem({<div className="flex-shrink-0 mr-3">{isEvent ? (<MousePointerClick className="w-4 h-4 text-amber-500" />- ) : (isError ? (+ ) : isError ? (<TriangleAlert className="w-4 h-4 text-red-500" />) : (<FileText className="w-4 h-4 text-blue-500" />- ))}+ )}</div><div className="flex-1 min-w-0 mr-4">{isPageview ? (<Link- href={`https://${item.hostname}${item.pathname}${- item.querystring ? `${item.querystring}` : ""- }`}+ href={`https://${item.hostname}${item.pathname}${item.querystring ? `${item.querystring}` : ""}`}target="_blank"rel="noopener noreferrer">@@ -124,33 +117,28 @@ function PageviewItem({)}</div>- <div className="text-xs text-gray-400 flex-shrink-0">- {formattedTime}- </div>+ <div className="text-xs text-neutral-400 flex-shrink-0">{formattedTime}</div></div>{isPageview && duration && (<div className="flex items-center pl-7 mt-1">- <div className="text-xs text-gray-400">- <Clock className="w-3 h-3 inline mr-1 text-gray-400" />+ <div className="text-xs text-neutral-400">+ <Clock className="w-3 h-3 inline mr-1 text-neutral-400" />{duration}</div></div>)}{isEvent && (<div className="flex items-center pl-7 mt-1">- <div className="text-xs text-gray-400">+ <div className="text-xs text-neutral-400">{item.props && Object.keys(item.props).length > 0 ? (<span className="flex flex-wrap gap-2 mt-1">{Object.entries(item.props).map(([key, value]) => (<Badgekey={key}variant="outline"- className="px-1.5 py-0 h-5 text-xs bg-neutral-800 text-gray-100 font-medium"+ className="px-1.5 py-0 h-5 text-xs bg-neutral-800 text-neutral-100 font-medium">- <span className="text-gray-300 font-light mr-1">- {key}:- </span>{" "}- {String(value)}+ <span className="text-neutral-300 font-light mr-1">{key}:</span> {String(value)}</Badge>))}</span>@@ -160,33 +148,27 @@ function PageviewItem({)}{isError && (<div className="flex items-center pl-7 mt-1">- <div className="text-xs text-gray-400">+ <div className="text-xs text-neutral-400">{item.props ? (<span>{item.props.message && (<Badgekey="message"variant="outline"- className="px-1.5 py-0 h-5 text-xs bg-neutral-800 text-gray-100 font-medium"+ className="px-1.5 py-0 h-5 text-xs bg-neutral-800 text-neutral-100 font-medium">- <span className="text-gray-300 font-light mr-1">- message:- </span>{" "}- {String(item.props.message)}+ <span className="text-neutral-300 font-light mr-1">message:</span> {String(item.props.message)}</Badge>)}{item.props.stack && (<div>- <p className="mt-2 mb-1 text-gray-300 font-light">- Stack Trace:- </p>+ <p className="mt-2 mb-1 text-neutral-300 font-light">Stack Trace:</p><pre className="text-xs text-neutral-100 bg-neutral-800 p-2 rounded overflow-x-auto whitespace-pre-wrap break-words">{item.props.stack}</pre></div>)}-</span>) : null}</div>@@ -198,69 +180,49 @@ function PageviewItem({}// Memoized skeleton component for the session details timeline-const SessionDetailsTimelineSkeleton = memo(- ({ itemCount }: { itemCount: number }) => {- // Function to get a random width class for skeletons- const getRandomWidth = () => {- const widths = [- "w-28",- "w-36",- "w-44",- "w-52",- "w-60",- "w-72",- "w-80",- "w-96",- "w-full",- ];- return widths[Math.floor(Math.random() * widths.length)];- };-- return (- <div className="py-4">- {/* Tabs skeleton */}- <div className="flex gap-2 mb-6">- <Skeleton className="h-8 w-24 rounded-md" />- <Skeleton className="h-8 w-24 rounded-md" />- </div>+const SessionDetailsTimelineSkeleton = memo(({ itemCount }: { itemCount: number }) => {+ // Function to get a random width class for skeletons+ const getRandomWidth = () => {+ const widths = ["w-28", "w-36", "w-44", "w-52", "w-60", "w-72", "w-80", "w-96", "w-full"];+ return widths[Math.floor(Math.random() * widths.length)];+ };- {/* Timeline tab skeleton */}- <div className="mb-4">- <div className="flex gap-2 mb-3">- <Skeleton className="h-6 w-32 rounded-full" />- <Skeleton className="h-6 w-32 rounded-full" />- </div>+ return (+ <div className="py-4">+ {/* Tabs skeleton */}+ <div className="flex gap-2 mb-6">+ <Skeleton className="h-8 w-24 rounded-md" />+ <Skeleton className="h-8 w-24 rounded-md" />+ </div>- {/* Timeline items skeleton */}- {Array.from({ length: Math.min(itemCount, 100) }).map((_, i) => (- <div key={i} className="flex mb-3">- <Skeleton className="h-8 w-8 rounded-full" />- <div className="ml-3 flex-1">- <div className="flex items-center">- <Skeleton className="h-4 w-4 mr-3" />- <Skeleton- className={cn("h-4", getRandomWidth(), "max-w-md mr-4")}- />- <Skeleton className="h-3 w-16 flex-shrink-0 ml-auto" />- </div>- <div className="mt-1 pl-7">- {Math.random() > 0.5 && (- <Skeleton- className={cn(- "h-3",- Math.random() > 0.7 ? "w-48" : "w-32"- )}- />- )}- </div>+ {/* Timeline tab skeleton */}+ <div className="mb-4">+ <div className="flex gap-2 mb-3">+ <Skeleton className="h-6 w-32 rounded-sm" />+ <Skeleton className="h-6 w-28 rounded-sm" />+ <Skeleton className="h-6 w-28 rounded-sm" />+ </div>++ {/* Timeline items skeleton */}+ {Array.from({ length: Math.min(itemCount, 100) }).map((_, i) => (+ <div key={i} className="flex mb-3">+ <Skeleton className="h-8 w-8 rounded-full" />+ <div className="ml-3 flex-1">+ <div className="flex items-center">+ <Skeleton className="h-4 w-4 mr-3" />+ <Skeleton className={cn("h-4", getRandomWidth(), "max-w-md mr-4")} />+ <Skeleton className="h-3 w-16 flex-shrink-0 ml-auto" />+ </div>+ <div className="mt-1 pl-7">+ {Math.random() > 0.5 && <Skeleton className={cn("h-3", Math.random() > 0.7 ? "w-48" : "w-32")} />}</div></div>- ))}- </div>+ </div>+ ))}</div>- );- }-);+ </div>+ );+});interface SessionDetailsProps {session: GetSessionsResponse[number];@@ -305,14 +267,10 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {return (<div className="px-4 bg-neutral-900 border-t border-neutral-800">{isLoading ? (- <SessionDetailsTimelineSkeleton- itemCount={session.pageviews + session.events}- />+ <SessionDetailsTimelineSkeleton itemCount={session.pageviews + session.events} />) : error ? (<Alert variant="destructive" className="mt-4">- <AlertDescription>- Error loading session details. Please try again.- </AlertDescription>+ <AlertDescription>Error loading session details. Please try again.</AlertDescription></Alert>) : sessionDetailsData?.pages[0]?.data ? (<Tabs defaultValue="timeline" className="mt-4">@@ -323,7 +281,7 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {</TabsList>{!userId && (<Link href={`/${site}/user/${session.user_id}`}>- <Button variant={"accent"}>+ <Button size={"sm"} variant={"success"}>View User <ArrowRight className="w-4 h-4" /></Button></Link>@@ -331,85 +289,53 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {</div><TabsContent value="timeline" className="mt-4">- <div className="mb-3">- <div className="flex gap-2 mb-2">- <Badge- variant="outline"- className="flex items-center gap-1 text-gray-300 bg-blue-500/60"- >- <FileText className="w-3 h-3" />- <span>- Pageviews: {totalPageviews}- {sessionDetailsData.pages[0]?.data?.pagination?.total >- allEvents.length &&- ` of ${sessionDetailsData.pages[0]?.data?.pagination?.total}`}- </span>- </Badge>- <Badge- variant="outline"- className="flex items-center gap-1 text-gray-300 bg-amber-500/60"- >- <MousePointerClick className="w-3 h-3" />- <span>Events: {totalEvents}</span>- </Badge>- <Badge- variant="outline"- className="flex items-center gap-1 text-gray-300 bg-red-500/60"- >- <TriangleAlert className="w-3 h-3" />- <span>Errors: {totalErrors}</span>- </Badge>- </div>- <div className="px-1 pt-2 pb-1">- {allEvents.map((pageview: SessionEvent, index: number) => {- // Determine the next timestamp for duration calculation- // For the last item, use the session end time- let nextTimestamp;- if (index < allEvents.length - 1) {- nextTimestamp = allEvents[index + 1].timestamp;- } else if (sessionDetails) {- nextTimestamp = sessionDetails.session_end;- }-- return (- <PageviewItem- key={`${pageview.timestamp}-${index}`}- item={pageview}- index={index}- isLast={index === allEvents.length - 1 && !hasNextPage}- nextTimestamp={nextTimestamp}- />- );- })}-- {hasNextPage && (- <div className="flex justify-center mt-6 mb-4">- <Button- onClick={() => fetchNextPage()}- disabled={isFetchingNextPage}- variant="outline"- className="flex items-center gap-2"- >- {isFetchingNextPage ? (- <>- <Loader2 className="h-4 w-4 animate-spin" />- <span>Loading...</span>- </>- ) : (- <span>Load More</span>- )}- </Button>- </div>- )}+ <div className="mb-4 px-1">+ {allEvents.map((pageview: SessionEvent, index: number) => {+ // Determine the next timestamp for duration calculation+ // For the last item, use the session end time+ let nextTimestamp;+ if (index < allEvents.length - 1) {+ nextTimestamp = allEvents[index + 1].timestamp;+ } else if (sessionDetails) {+ nextTimestamp = sessionDetails.session_end;+ }++ return (+ <PageviewItem+ key={`${pageview.timestamp}-${index}`}+ item={pageview}+ index={index}+ isLast={index === allEvents.length - 1 && !hasNextPage}+ nextTimestamp={nextTimestamp}+ />+ );+ })}++ {hasNextPage && (+ <div className="flex justify-center mt-6 mb-4">+ <Button+ onClick={() => fetchNextPage()}+ disabled={isFetchingNextPage}+ variant="outline"+ className="flex items-center gap-2"+ >+ {isFetchingNextPage ? (+ <>+ <Loader2 className="h-4 w-4 animate-spin" />+ <span>Loading...</span>+ </>+ ) : (+ <span>Load More</span>+ )}+ </Button>+ </div>+ )}- {sessionDetailsData.pages[0]?.data?.pagination?.total > 0 && (- <div className="text-center text-xs text-gray-500 mt-2">- Showing {allEvents.length} of{" "}- {sessionDetailsData.pages[0]?.data?.pagination?.total}{" "}- events- </div>- )}- </div>+ {sessionDetailsData.pages[0]?.data?.pagination?.total > 0 && (+ <div className="text-center text-xs text-neutral-500 mt-2">+ Showing {allEvents.length} of {sessionDetailsData.pages[0]?.data?.pagination?.total} events+ </div>+ )}</div></TabsContent>@@ -417,7 +343,7 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {<div className="grid grid-cols-1 lg:grid-cols-[auto_auto_auto] gap-8 mb-6">{/* User Information */}<div>- <h4 className="text-sm font-medium mb-3 text-gray-300 border-b border-neutral-800 pb-2">+ <h4 className="text-sm font-medium mb-3 text-neutral-300 border-b border-neutral-800 pb-2">User Information</h4><div className="space-y-3">@@ -427,25 +353,13 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {<Avatar size={24} name={sessionDetails.user_id} /></div><div>- <div className="text-sm text-gray-400 flex items-center">- <span className="font-medium text-gray-300">- User ID:- </span>- <CopyText- text={sessionDetails.user_id}- maxLength={24}- className="inline-flex ml-2"- />+ <div className="text-sm text-neutral-400 flex items-center">+ <span className="font-medium text-neutral-300">User ID:</span>+ <CopyText text={sessionDetails.user_id} maxLength={24} className="inline-flex ml-2" /></div>- <div className="text-sm text-gray-400 flex items-center">- <span className="font-medium text-gray-300">- Session ID:- </span>- <CopyText- text={sessionDetails.session_id}- maxLength={20}- className="inline-flex ml-2"- />+ <div className="text-sm text-neutral-400 flex items-center">+ <span className="font-medium text-neutral-300">Session ID:</span>+ <CopyText text={sessionDetails.session_id} maxLength={20} className="inline-flex ml-2" /></div></div></div>@@ -454,50 +368,33 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {<div className="space-y-2">{sessionDetails?.language && (<div className="text-sm flex items-center gap-2">- <span className="font-medium text-gray-300 min-w-[80px]">- Language:- </span>- <span className="text-gray-400">- {sessionDetails.language- ? getLanguageName(sessionDetails.language)- : "N/A"}+ <span className="font-medium text-neutral-300 min-w-[80px]">Language:</span>+ <span className="text-neutral-400">+ {sessionDetails.language ? getLanguageName(sessionDetails.language) : "N/A"}</span></div>)}{sessionDetails?.country && (<div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Country:- </span>- <div className="flex items-center gap-1 text-gray-400">+ <span className="font-medium text-neutral-300 min-w-[80px]">Country:</span>+ <div className="flex items-center gap-1 text-neutral-400"><CountryFlag country={sessionDetails.country} /><span>{getCountryName(sessionDetails.country)}</span>- {sessionDetails.region && (- <span>({sessionDetails.region})</span>- )}+ {sessionDetails.region && <span>({sessionDetails.region})</span>}</div></div>)}- {sessionDetails?.region &&- getRegionName(sessionDetails.region) && (- <div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Region:- </span>- <span className="text-gray-400">- {getRegionName(sessionDetails.region)}- </span>- </div>- )}+ {sessionDetails?.region && getRegionName(sessionDetails.region) && (+ <div className="flex items-center gap-2 text-sm">+ <span className="font-medium text-neutral-300 min-w-[80px]">Region:</span>+ <span className="text-neutral-400">{getRegionName(sessionDetails.region)}</span>+ </div>+ )}{sessionDetails?.city && (<div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- City:- </span>- <span className="text-gray-400">- {sessionDetails.city}- </span>+ <span className="font-medium text-neutral-300 min-w-[80px]">City:</span>+ <span className="text-neutral-400">{sessionDetails.city}</span></div>)}</div>@@ -506,73 +403,51 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {{/* Device Information */}<div>- <h4 className="text-sm font-medium mb-3 text-gray-300 border-b border-neutral-800 pb-2">+ <h4 className="text-sm font-medium mb-3 text-neutral-300 border-b border-neutral-800 pb-2">Device Information</h4><div className="space-y-3"><div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Device:- </span>- <div className="flex items-center gap-1.5 text-gray-400">- {sessionDetails?.device_type === "Desktop" && (- <Monitor className="w-4 h-4" />- )}- {sessionDetails?.device_type === "Mobile" && (- <Smartphone className="w-4 h-4" />- )}- {sessionDetails?.device_type === "Tablet" && (- <Tablet className="w-4 h-4" />- )}+ <span className="font-medium text-neutral-300 min-w-[80px]">Device:</span>+ <div className="flex items-center gap-1.5 text-neutral-400">+ {sessionDetails?.device_type === "Desktop" && <Monitor className="w-4 h-4" />}+ {sessionDetails?.device_type === "Mobile" && <Smartphone className="w-4 h-4" />}+ {sessionDetails?.device_type === "Tablet" && <Tablet className="w-4 h-4" />}<span>{sessionDetails?.device_type || "Unknown"}</span></div></div><div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Browser:- </span>- <div className="flex items-center gap-1.5 text-gray-400">+ <span className="font-medium text-neutral-300 min-w-[80px]">Browser:</span>+ <div className="flex items-center gap-1.5 text-neutral-400"><Browser browser={sessionDetails?.browser || "Unknown"} /><span>{sessionDetails?.browser || "Unknown"}{sessionDetails?.browser_version && (- <span className="ml-1">- v{sessionDetails.browser_version}- </span>+ <span className="ml-1">v{sessionDetails.browser_version}</span>)}</span></div></div><div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- OS:- </span>- <div className="flex items-center gap-1.5 text-gray-400">- <OperatingSystem- os={sessionDetails?.operating_system || ""}- />+ <span className="font-medium text-neutral-300 min-w-[80px]">OS:</span>+ <div className="flex items-center gap-1.5 text-neutral-400">+ <OperatingSystem os={sessionDetails?.operating_system || ""} /><span>{sessionDetails?.operating_system || "Unknown"}{sessionDetails?.operating_system_version && (- <span className="ml-1">- {sessionDetails.operating_system_version}- </span>+ <span className="ml-1">{sessionDetails.operating_system_version}</span>)}</span></div></div>- {sessionDetails?.screen_width &&- sessionDetails?.screen_height ? (+ {sessionDetails?.screen_width && sessionDetails?.screen_height ? (<div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Screen:- </span>- <span className="text-gray-400">- {sessionDetails.screen_width} ×{" "}- {sessionDetails.screen_height}+ <span className="font-medium text-neutral-300 min-w-[80px]">Screen:</span>+ <span className="text-neutral-400">+ {sessionDetails.screen_width} × {sessionDetails.screen_height}</span></div>) : null}@@ -581,33 +456,27 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {{/* Source Information */}<div>- <h4 className="text-sm font-medium mb-3 text-gray-300 border-b border-neutral-800 pb-2">+ <h4 className="text-sm font-medium mb-3 text-neutral-300 border-b border-neutral-800 pb-2">Source Information</h4><div className="space-y-3"><div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Channel:- </span>- <div className="flex items-center gap-1.5 text-gray-400">+ <span className="font-medium text-neutral-300 min-w-[80px]">Channel:</span>+ <div className="flex items-center gap-1.5 text-neutral-400"><span>{sessionDetails?.channel || "None"}</span></div></div><div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Referrer:- </span>- <div className="flex items-center gap-1.5 text-gray-400">+ <span className="font-medium text-neutral-300 min-w-[80px]">Referrer:</span>+ <div className="flex items-center gap-1.5 text-neutral-400"><span>{sessionDetails?.referrer || "None"}</span></div></div><div className="flex items-center gap-2 text-sm">- <span className="font-medium text-gray-300 min-w-[80px]">- Entry Page:- </span>- <div className="flex items-center gap-1.5 text-gray-400">+ <span className="font-medium text-neutral-300 min-w-[80px]">Entry Page:</span>+ <div className="flex items-center gap-1.5 text-neutral-400"><span>{sessionDetails?.entry_page || "None"}</span></div></div>@@ -617,7 +486,7 @@ export function SessionDetails({ session, userId }: SessionDetailsProps) {</TabsContent></Tabs>) : (- <div className="py-4 text-center text-gray-400">No data available</div>+ <div className="py-4 text-center text-neutral-400">No data available</div>)}</div>);