fix: general ui fixes
This commit is contained in:
@@ -3,7 +3,6 @@ import { ProjectLink } from '@/components/links';
|
|||||||
import { SerieIcon } from '@/components/report-chart/common/serie-icon';
|
import { SerieIcon } from '@/components/report-chart/common/serie-icon';
|
||||||
import { useNumber } from '@/hooks/use-numer-formatter';
|
import { useNumber } from '@/hooks/use-numer-formatter';
|
||||||
import { pushModal } from '@/modals';
|
import { pushModal } from '@/modals';
|
||||||
import { formatDateTime, formatTimeAgoOrDateTime, timeAgo } from '@/utils/date';
|
|
||||||
import { getProfileName } from '@/utils/getters';
|
import { getProfileName } from '@/utils/getters';
|
||||||
import type { ColumnDef } from '@tanstack/react-table';
|
import type { ColumnDef } from '@tanstack/react-table';
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ export function useColumns() {
|
|||||||
accessorKey: 'name',
|
accessorKey: 'name',
|
||||||
header: 'Name',
|
header: 'Name',
|
||||||
cell({ row }) {
|
cell({ row }) {
|
||||||
const { name, path, duration } = row.original;
|
const { name, path, duration, properties } = row.original;
|
||||||
const renderName = () => {
|
const renderName = () => {
|
||||||
if (name === 'screen_view') {
|
if (name === 'screen_view') {
|
||||||
if (path.includes('/')) {
|
if (path.includes('/')) {
|
||||||
@@ -209,7 +208,7 @@ export function useColumns() {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
const items = Object.entries(filteredProperties);
|
const items = Object.entries(filteredProperties);
|
||||||
const limit = 1;
|
const limit = 2;
|
||||||
const data = items.slice(0, limit).map(([key, value]) => ({
|
const data = items.slice(0, limit).map(([key, value]) => ({
|
||||||
name: key,
|
name: key,
|
||||||
value: value,
|
value: value,
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export function OverviewLiveHistogram({
|
|||||||
<Wrapper
|
<Wrapper
|
||||||
count={totalSessions}
|
count={totalSessions}
|
||||||
icons={
|
icons={
|
||||||
<div className="row gap-2">
|
<div className="row gap-2 shrink-0">
|
||||||
{liveData.referrers.slice(0, 3).map((ref, index) => (
|
{liveData.referrers.slice(0, 3).map((ref, index) => (
|
||||||
<div
|
<div
|
||||||
key={`${ref.referrer}-${ref.count}-${index}`}
|
key={`${ref.referrer}-${ref.count}-${index}`}
|
||||||
@@ -107,11 +107,11 @@ interface WrapperProps {
|
|||||||
function Wrapper({ children, count, icons }: WrapperProps) {
|
function Wrapper({ children, count, icons }: WrapperProps) {
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full flex-col">
|
<div className="flex h-full flex-col">
|
||||||
<div className="row gap-2 justify-between">
|
<div className="row gap-2 justify-between items-center">
|
||||||
<div className="relative mb-1 text-xs font-medium text-muted-foreground">
|
<div className="relative text-xs font-medium text-muted-foreground">
|
||||||
{count} sessions last 30 min
|
{count} sessions last 30 min
|
||||||
</div>
|
</div>
|
||||||
<div>{icons}</div>
|
{icons}
|
||||||
</div>
|
</div>
|
||||||
<div className="relative flex h-full w-full flex-1 items-end justify-center gap-2">
|
<div className="relative flex h-full w-full flex-1 items-end justify-center gap-2">
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export function RealtimeActiveSessions({
|
|||||||
const sessions = state.length > 0 ? state : (activeSessionsQuery.data ?? []);
|
const sessions = state.length > 0 ? state : (activeSessionsQuery.data ?? []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="col h-full">
|
<div className="col h-full max-md:hidden">
|
||||||
<div className="hide-scrollbar h-full overflow-y-auto pb-10">
|
<div className="hide-scrollbar h-full overflow-y-auto pb-10">
|
||||||
<AnimatePresence mode="popLayout" initial={false}>
|
<AnimatePresence mode="popLayout" initial={false}>
|
||||||
<div className="col gap-4">
|
<div className="col gap-4">
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ export function RealtimeGeo({ projectId }: RealtimeGeoProps) {
|
|||||||
{
|
{
|
||||||
name: 'Country / City',
|
name: 'Country / City',
|
||||||
width: 'w-full',
|
width: 'w-full',
|
||||||
|
responsive: { priority: 1 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<Tooltiper
|
<Tooltiper
|
||||||
@@ -69,6 +70,7 @@ export function RealtimeGeo({ projectId }: RealtimeGeoProps) {
|
|||||||
{
|
{
|
||||||
name: 'Duration',
|
name: 'Duration',
|
||||||
width: '75px',
|
width: '75px',
|
||||||
|
responsive: { priority: 7 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return number.shortWithUnit(item.avg_duration, 'min');
|
return number.shortWithUnit(item.avg_duration, 'min');
|
||||||
},
|
},
|
||||||
@@ -76,6 +78,7 @@ export function RealtimeGeo({ projectId }: RealtimeGeoProps) {
|
|||||||
{
|
{
|
||||||
name: 'Events',
|
name: 'Events',
|
||||||
width: '60px',
|
width: '60px',
|
||||||
|
responsive: { priority: 4 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<div className="row gap-2 justify-end">
|
<div className="row gap-2 justify-end">
|
||||||
@@ -89,6 +92,7 @@ export function RealtimeGeo({ projectId }: RealtimeGeoProps) {
|
|||||||
{
|
{
|
||||||
name: 'Sessions',
|
name: 'Sessions',
|
||||||
width: '82px',
|
width: '82px',
|
||||||
|
responsive: { priority: 2 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<div className="row gap-2 justify-end">
|
<div className="row gap-2 justify-end">
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export function RealtimeLiveHistogram({
|
|||||||
count={totalVisitors}
|
count={totalVisitors}
|
||||||
icons={
|
icons={
|
||||||
liveData.referrers && liveData.referrers.length > 0 ? (
|
liveData.referrers && liveData.referrers.length > 0 ? (
|
||||||
<div className="row gap-2">
|
<div className="row gap-2 shrink-0">
|
||||||
{liveData.referrers.slice(0, 3).map((ref, index) => (
|
{liveData.referrers.slice(0, 3).map((ref, index) => (
|
||||||
<div
|
<div
|
||||||
key={`${ref.referrer}-${ref.count}-${index}`}
|
key={`${ref.referrer}-${ref.count}-${index}`}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export function RealtimePaths({ projectId }: RealtimePathsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Path',
|
name: 'Path',
|
||||||
width: 'w-full',
|
width: 'w-full',
|
||||||
|
responsive: { priority: 1 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<Tooltiper
|
<Tooltiper
|
||||||
@@ -76,6 +77,7 @@ export function RealtimePaths({ projectId }: RealtimePathsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Duration',
|
name: 'Duration',
|
||||||
width: '75px',
|
width: '75px',
|
||||||
|
responsive: { priority: 7 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return number.shortWithUnit(item.avg_duration, 'min');
|
return number.shortWithUnit(item.avg_duration, 'min');
|
||||||
},
|
},
|
||||||
@@ -83,6 +85,7 @@ export function RealtimePaths({ projectId }: RealtimePathsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Events',
|
name: 'Events',
|
||||||
width: '60px',
|
width: '60px',
|
||||||
|
responsive: { priority: 4 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<div className="row gap-2 justify-end">
|
<div className="row gap-2 justify-end">
|
||||||
@@ -96,6 +99,7 @@ export function RealtimePaths({ projectId }: RealtimePathsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Sessions',
|
name: 'Sessions',
|
||||||
width: '82px',
|
width: '82px',
|
||||||
|
responsive: { priority: 2 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<div className="row gap-2 justify-end">
|
<div className="row gap-2 justify-end">
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ export function RealtimeReferrals({ projectId }: RealtimeReferralsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Referrer',
|
name: 'Referrer',
|
||||||
width: 'w-full',
|
width: 'w-full',
|
||||||
|
responsive: { priority: 1 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<Tooltiper asChild content={item.referrer_name} side="left">
|
<Tooltiper asChild content={item.referrer_name} side="left">
|
||||||
@@ -59,6 +60,7 @@ export function RealtimeReferrals({ projectId }: RealtimeReferralsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Duration',
|
name: 'Duration',
|
||||||
width: '75px',
|
width: '75px',
|
||||||
|
responsive: { priority: 7 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return number.shortWithUnit(item.avg_duration, 'min');
|
return number.shortWithUnit(item.avg_duration, 'min');
|
||||||
},
|
},
|
||||||
@@ -66,6 +68,7 @@ export function RealtimeReferrals({ projectId }: RealtimeReferralsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Events',
|
name: 'Events',
|
||||||
width: '60px',
|
width: '60px',
|
||||||
|
responsive: { priority: 4 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<div className="row gap-2 justify-end">
|
<div className="row gap-2 justify-end">
|
||||||
@@ -79,6 +82,7 @@ export function RealtimeReferrals({ projectId }: RealtimeReferralsProps) {
|
|||||||
{
|
{
|
||||||
name: 'Sessions',
|
name: 'Sessions',
|
||||||
width: '82px',
|
width: '82px',
|
||||||
|
responsive: { priority: 2 },
|
||||||
render(item) {
|
render(item) {
|
||||||
return (
|
return (
|
||||||
<div className="row gap-2 justify-end">
|
<div className="row gap-2 justify-end">
|
||||||
|
|||||||
@@ -15,13 +15,12 @@ export function Chart({ data }: Props) {
|
|||||||
const {
|
const {
|
||||||
report: { metric, unit },
|
report: { metric, unit },
|
||||||
} = useReportChartContext();
|
} = useReportChartContext();
|
||||||
const { series } = useVisibleSeries(data, 100);
|
const { series } = useVisibleSeries(data, 99999);
|
||||||
const [filters, setFilter] = useEventQueryFilters();
|
const [_, setFilter] = useEventQueryFilters();
|
||||||
|
|
||||||
const mapData = useMemo(
|
const mapData = useMemo(
|
||||||
() =>
|
() =>
|
||||||
series.map((s) => ({
|
series.map((s) => ({
|
||||||
country: s.names[0]?.toLowerCase() ?? '',
|
country: s.names[1]?.toLowerCase() ?? '',
|
||||||
value: s.metrics[metric] ?? 0,
|
value: s.metrics[metric] ?? 0,
|
||||||
})),
|
})),
|
||||||
[series, metric],
|
[series, metric],
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ import { useTRPC } from '@/integrations/trpc/react';
|
|||||||
import { cn } from '@/utils/cn';
|
import { cn } from '@/utils/cn';
|
||||||
import { getProfileName } from '@/utils/getters';
|
import { getProfileName } from '@/utils/getters';
|
||||||
import type { IClickhouseEvent, IServiceEvent } from '@openpanel/db';
|
import type { IClickhouseEvent, IServiceEvent } from '@openpanel/db';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useSuspenseQuery } from '@tanstack/react-query';
|
||||||
import { FilterIcon, XIcon } from 'lucide-react';
|
import { FilterIcon, XIcon } from 'lucide-react';
|
||||||
import { omit } from 'ramda';
|
import { omit } from 'ramda';
|
||||||
import { useState } from 'react';
|
import { Suspense, useState } from 'react';
|
||||||
import { popModal } from '.';
|
import { popModal } from '.';
|
||||||
import { ModalContent } from './Modal/Container';
|
import { ModalContent } from './Modal/Container';
|
||||||
|
|
||||||
@@ -52,7 +52,19 @@ const filterable: Partial<Record<keyof IServiceEvent, keyof IClickhouseEvent>> =
|
|||||||
origin: 'origin',
|
origin: 'origin',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function EventDetails({ id, createdAt, projectId }: Props) {
|
export default function EventDetails(props: Props) {
|
||||||
|
return (
|
||||||
|
<ModalContent className="!p-0">
|
||||||
|
<Widget className="bg-transparent border-0 min-w-0">
|
||||||
|
<Suspense fallback={<EventDetailsSkeleton />}>
|
||||||
|
<EventDetailsContent {...props} />
|
||||||
|
</Suspense>
|
||||||
|
</Widget>
|
||||||
|
</ModalContent>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function EventDetailsContent({ id, createdAt, projectId }: Props) {
|
||||||
const [, setEvents] = useEventQueryNamesFilter();
|
const [, setEvents] = useEventQueryNamesFilter();
|
||||||
const [, setFilter] = useEventQueryFilters();
|
const [, setFilter] = useEventQueryFilters();
|
||||||
const TABS = {
|
const TABS = {
|
||||||
@@ -67,7 +79,7 @@ export default function EventDetails({ id, createdAt, projectId }: Props) {
|
|||||||
};
|
};
|
||||||
const [widget, setWidget] = useState(TABS.essentials);
|
const [widget, setWidget] = useState(TABS.essentials);
|
||||||
const trpc = useTRPC();
|
const trpc = useTRPC();
|
||||||
const query = useQuery(
|
const query = useSuspenseQuery(
|
||||||
trpc.event.details.queryOptions({
|
trpc.event.details.queryOptions({
|
||||||
id,
|
id,
|
||||||
projectId,
|
projectId,
|
||||||
@@ -75,10 +87,6 @@ export default function EventDetails({ id, createdAt, projectId }: Props) {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!query.data) {
|
|
||||||
return <EventDetailsSkeleton />;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { event, session } = query.data;
|
const { event, session } = query.data;
|
||||||
|
|
||||||
const profile = event.profile;
|
const profile = event.profile;
|
||||||
@@ -172,13 +180,12 @@ export default function EventDetails({ id, createdAt, projectId }: Props) {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalContent className="!p-0">
|
<>
|
||||||
<Widget className="bg-transparent border-0 min-w-0">
|
<WidgetHead>
|
||||||
<WidgetHead>
|
<div className="row items-center justify-between">
|
||||||
<div className="row items-center justify-between">
|
<div className="title">{event.name}</div>
|
||||||
<div className="title">{event.name}</div>
|
<div className="row items-center gap-2 pr-2">
|
||||||
<div className="row items-center gap-2 pr-2">
|
{/* <Button
|
||||||
{/* <Button
|
|
||||||
size="icon"
|
size="icon"
|
||||||
variant={'ghost'}
|
variant={'ghost'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -202,251 +209,242 @@ export default function EventDetails({ id, createdAt, projectId }: Props) {
|
|||||||
>
|
>
|
||||||
<ArrowRightIcon className="size-4" />
|
<ArrowRightIcon className="size-4" />
|
||||||
</Button> */}
|
</Button> */}
|
||||||
<Button size="icon" variant={'ghost'} onClick={() => popModal()}>
|
<Button size="icon" variant={'ghost'} onClick={() => popModal()}>
|
||||||
<XIcon className="size-4" />
|
<XIcon className="size-4" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<WidgetButtons>
|
<WidgetButtons>
|
||||||
{Object.entries(TABS).map(([, tab]) => (
|
{Object.entries(TABS).map(([, tab]) => (
|
||||||
<button
|
<button
|
||||||
key={tab.id}
|
key={tab.id}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setWidget(tab)}
|
onClick={() => setWidget(tab)}
|
||||||
className={cn(tab.id === widget.id && 'active')}
|
className={cn(tab.id === widget.id && 'active')}
|
||||||
>
|
|
||||||
{tab.title}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</WidgetButtons>
|
|
||||||
</WidgetHead>
|
|
||||||
<WidgetBody className="col gap-4 bg-def-100">
|
|
||||||
{profile && (
|
|
||||||
<ProjectLink
|
|
||||||
onClick={() => popModal()}
|
|
||||||
href={`/profiles/${profile.id}`}
|
|
||||||
className="card p-4 py-2 col gap-2 hover:bg-def-100"
|
|
||||||
>
|
>
|
||||||
<div className="row items-center gap-2 justify-between">
|
{tab.title}
|
||||||
<div className="row items-center gap-2 min-w-0">
|
</button>
|
||||||
{profile.avatar && (
|
))}
|
||||||
<img
|
</WidgetButtons>
|
||||||
className="size-4 bg-border rounded-full"
|
</WidgetHead>
|
||||||
src={profile.avatar}
|
<WidgetBody className="col gap-4 bg-def-100">
|
||||||
/>
|
{profile && (
|
||||||
)}
|
<ProjectLink
|
||||||
<div className="font-medium truncate">
|
onClick={() => popModal()}
|
||||||
{getProfileName(profile, false)}
|
href={`/profiles/${profile.id}`}
|
||||||
</div>
|
className="card p-4 py-2 col gap-2 hover:bg-def-100"
|
||||||
</div>
|
>
|
||||||
<div className="row items-center gap-2 shrink-0">
|
<div className="row items-center gap-2 justify-between">
|
||||||
<div className="row gap-1 items-center">
|
<div className="row items-center gap-2 min-w-0">
|
||||||
<SerieIcon name={event.country} />
|
{profile.avatar && (
|
||||||
<SerieIcon name={event.os} />
|
<img
|
||||||
<SerieIcon name={event.browser} />
|
className="size-4 bg-border rounded-full"
|
||||||
</div>
|
src={profile.avatar}
|
||||||
<div className="text-muted-foreground truncate max-w-40">
|
/>
|
||||||
{event.referrerName || event.referrer}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{!!session && (
|
|
||||||
<div className="text-sm">
|
|
||||||
This session has {session.screenViewCount} screen views and{' '}
|
|
||||||
{session.eventCount} events. Visit duration is{' '}
|
|
||||||
{fancyMinutes(session.duration / 1000)}.
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</ProjectLink>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{properties.length > 0 && (
|
|
||||||
<section>
|
|
||||||
<div className="mb-2 flex justify-between font-medium">
|
|
||||||
<div>Properties</div>
|
|
||||||
</div>
|
|
||||||
<KeyValueGrid
|
|
||||||
columns={1}
|
|
||||||
data={properties}
|
|
||||||
renderValue={(item) => (
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<span className="font-mono">{String(item.value)}</span>
|
|
||||||
<FilterIcon className="size-3 shrink-0" />
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
onItemClick={(item) => {
|
<div className="font-medium truncate">
|
||||||
popModal();
|
{getProfileName(profile, false)}
|
||||||
setFilter(`properties.${item.name}`, item.value as any);
|
</div>
|
||||||
}}
|
</div>
|
||||||
/>
|
<div className="row items-center gap-2 shrink-0">
|
||||||
</section>
|
<div className="row gap-1 items-center">
|
||||||
)}
|
<SerieIcon name={event.country} />
|
||||||
|
<SerieIcon name={event.os} />
|
||||||
|
<SerieIcon name={event.browser} />
|
||||||
|
</div>
|
||||||
|
<div className="text-muted-foreground truncate max-w-40">
|
||||||
|
{event.referrerName || event.referrer}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{!!session && (
|
||||||
|
<div className="text-sm">
|
||||||
|
This session has {session.screenViewCount} screen views and{' '}
|
||||||
|
{session.eventCount} events. Visit duration is{' '}
|
||||||
|
{fancyMinutes(session.duration / 1000)}.
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</ProjectLink>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{properties.length > 0 && (
|
||||||
<section>
|
<section>
|
||||||
<div className="mb-2 flex justify-between font-medium">
|
<div className="mb-2 flex justify-between font-medium">
|
||||||
<div>Information</div>
|
<div>Properties</div>
|
||||||
</div>
|
</div>
|
||||||
<KeyValueGrid
|
<KeyValueGrid
|
||||||
columns={1}
|
columns={1}
|
||||||
data={data}
|
data={properties}
|
||||||
renderValue={(item) => {
|
renderValue={(item) => (
|
||||||
const isFilterable =
|
<div className="flex items-center gap-2">
|
||||||
item.value && (filterable as any)[item.name];
|
<span className="font-mono">{String(item.value)}</span>
|
||||||
if (isFilterable) {
|
<FilterIcon className="size-3 shrink-0" />
|
||||||
return (
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
)}
|
||||||
<FieldValue
|
|
||||||
name={item.name}
|
|
||||||
value={item.value}
|
|
||||||
event={event}
|
|
||||||
/>
|
|
||||||
<FilterIcon className="size-3 shrink-0" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FieldValue
|
|
||||||
name={item.name}
|
|
||||||
value={item.value}
|
|
||||||
event={event}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
onItemClick={(item) => {
|
onItemClick={(item) => {
|
||||||
const isFilterable =
|
popModal();
|
||||||
item.value && (filterable as any)[item.name];
|
setFilter(`properties.${item.name}`, item.value as any);
|
||||||
if (isFilterable) {
|
|
||||||
popModal();
|
|
||||||
setFilter(item.name as keyof IServiceEvent, item.value);
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
)}
|
||||||
<div className="mb-2 flex justify-between font-medium">
|
<section>
|
||||||
<div>All events for {event.name}</div>
|
<div className="mb-2 flex justify-between font-medium">
|
||||||
<button
|
<div>Information</div>
|
||||||
type="button"
|
</div>
|
||||||
className="text-muted-foreground hover:underline"
|
<KeyValueGrid
|
||||||
onClick={() => {
|
columns={1}
|
||||||
setEvents([event.name]);
|
data={data}
|
||||||
popModal();
|
renderValue={(item) => {
|
||||||
}}
|
const isFilterable = item.value && (filterable as any)[item.name];
|
||||||
>
|
if (isFilterable) {
|
||||||
Show all
|
return (
|
||||||
</button>
|
<div className="flex items-center gap-2">
|
||||||
</div>
|
<FieldValue
|
||||||
<div className="card p-4">
|
name={item.name}
|
||||||
<ReportChartShortcut
|
value={item.value}
|
||||||
projectId={event.projectId}
|
event={event}
|
||||||
chartType="linear"
|
/>
|
||||||
series={[
|
<FilterIcon className="size-3 shrink-0" />
|
||||||
{
|
</div>
|
||||||
id: 'A',
|
);
|
||||||
name: event.name,
|
}
|
||||||
displayName: 'Similar events',
|
|
||||||
segment: 'event',
|
return (
|
||||||
filters: [],
|
<FieldValue name={item.name} value={item.value} event={event} />
|
||||||
type: 'event',
|
);
|
||||||
},
|
}}
|
||||||
]}
|
onItemClick={(item) => {
|
||||||
/>
|
const isFilterable = item.value && (filterable as any)[item.name];
|
||||||
</div>
|
if (isFilterable) {
|
||||||
</section>
|
popModal();
|
||||||
</WidgetBody>
|
setFilter(item.name as keyof IServiceEvent, item.value);
|
||||||
</Widget>
|
}
|
||||||
</ModalContent>
|
}}
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<div className="mb-2 flex justify-between font-medium">
|
||||||
|
<div>All events for {event.name}</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="text-muted-foreground hover:underline"
|
||||||
|
onClick={() => {
|
||||||
|
setEvents([event.name]);
|
||||||
|
popModal();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Show all
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="card p-4">
|
||||||
|
<ReportChartShortcut
|
||||||
|
projectId={event.projectId}
|
||||||
|
chartType="linear"
|
||||||
|
series={[
|
||||||
|
{
|
||||||
|
id: 'A',
|
||||||
|
name: event.name,
|
||||||
|
displayName: 'Similar events',
|
||||||
|
segment: 'event',
|
||||||
|
filters: [],
|
||||||
|
type: 'event',
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</WidgetBody>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function EventDetailsSkeleton() {
|
function EventDetailsSkeleton() {
|
||||||
return (
|
return (
|
||||||
<ModalContent className="!p-0">
|
<>
|
||||||
<Widget className="bg-transparent border-0 min-w-0">
|
<WidgetHead>
|
||||||
<WidgetHead>
|
<div className="row items-center justify-between">
|
||||||
<div className="row items-center justify-between">
|
<div className="h-6 w-32 bg-muted animate-pulse rounded" />
|
||||||
<div className="h-6 w-32 bg-muted animate-pulse rounded" />
|
<div className="row items-center gap-2 pr-2">
|
||||||
<div className="row items-center gap-2 pr-2">
|
<div className="h-8 w-8 bg-muted animate-pulse rounded" />
|
||||||
<div className="h-8 w-8 bg-muted animate-pulse rounded" />
|
<div className="h-8 w-8 bg-muted animate-pulse rounded" />
|
||||||
<div className="h-8 w-8 bg-muted animate-pulse rounded" />
|
<div className="h-8 w-8 bg-muted animate-pulse rounded" />
|
||||||
<div className="h-8 w-8 bg-muted animate-pulse rounded" />
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<WidgetButtons>
|
||||||
|
<div className="h-8 w-20 bg-muted animate-pulse rounded" />
|
||||||
|
<div className="h-8 w-20 bg-muted animate-pulse rounded" />
|
||||||
|
</WidgetButtons>
|
||||||
|
</WidgetHead>
|
||||||
|
<WidgetBody className="col gap-4 bg-def-100">
|
||||||
|
{/* Profile skeleton */}
|
||||||
|
<div className="card p-4 py-2 col gap-2">
|
||||||
|
<div className="row items-center gap-2 justify-between">
|
||||||
|
<div className="row items-center gap-2 min-w-0">
|
||||||
|
<div className="size-4 bg-muted animate-pulse rounded-full" />
|
||||||
|
<div className="h-4 w-24 bg-muted animate-pulse rounded" />
|
||||||
|
</div>
|
||||||
|
<div className="row items-center gap-2 shrink-0">
|
||||||
|
<div className="row gap-1 items-center">
|
||||||
|
<div className="size-4 bg-muted animate-pulse rounded" />
|
||||||
|
<div className="size-4 bg-muted animate-pulse rounded" />
|
||||||
|
<div className="size-4 bg-muted animate-pulse rounded" />
|
||||||
|
</div>
|
||||||
|
<div className="h-4 w-32 bg-muted animate-pulse rounded" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="h-4 w-64 bg-muted animate-pulse rounded" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<WidgetButtons>
|
{/* Properties skeleton */}
|
||||||
<div className="h-8 w-20 bg-muted animate-pulse rounded" />
|
<section>
|
||||||
<div className="h-8 w-20 bg-muted animate-pulse rounded" />
|
<div className="mb-2 flex justify-between font-medium">
|
||||||
</WidgetButtons>
|
<div className="h-5 w-20 bg-muted animate-pulse rounded" />
|
||||||
</WidgetHead>
|
</div>
|
||||||
<WidgetBody className="col gap-4 bg-def-100">
|
<div className="space-y-2">
|
||||||
{/* Profile skeleton */}
|
{Array.from({ length: 3 }).map((_, i) => (
|
||||||
<div className="card p-4 py-2 col gap-2">
|
<div
|
||||||
<div className="row items-center gap-2 justify-between">
|
key={i.toString()}
|
||||||
<div className="row items-center gap-2 min-w-0">
|
className="flex items-center justify-between p-3 bg-muted/50 rounded"
|
||||||
<div className="size-4 bg-muted animate-pulse rounded-full" />
|
>
|
||||||
<div className="h-4 w-24 bg-muted animate-pulse rounded" />
|
<div className="h-4 w-24 bg-muted animate-pulse rounded" />
|
||||||
</div>
|
|
||||||
<div className="row items-center gap-2 shrink-0">
|
|
||||||
<div className="row gap-1 items-center">
|
|
||||||
<div className="size-4 bg-muted animate-pulse rounded" />
|
|
||||||
<div className="size-4 bg-muted animate-pulse rounded" />
|
|
||||||
<div className="size-4 bg-muted animate-pulse rounded" />
|
|
||||||
</div>
|
|
||||||
<div className="h-4 w-32 bg-muted animate-pulse rounded" />
|
<div className="h-4 w-32 bg-muted animate-pulse rounded" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
))}
|
||||||
<div className="h-4 w-64 bg-muted animate-pulse rounded" />
|
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
{/* Properties skeleton */}
|
{/* Information skeleton */}
|
||||||
<section>
|
<section>
|
||||||
<div className="mb-2 flex justify-between font-medium">
|
<div className="mb-2 flex justify-between font-medium">
|
||||||
<div className="h-5 w-20 bg-muted animate-pulse rounded" />
|
<div className="h-5 w-24 bg-muted animate-pulse rounded" />
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
{Array.from({ length: 3 }).map((_, i) => (
|
{Array.from({ length: 6 }).map((_, i) => (
|
||||||
<div
|
<div
|
||||||
key={i.toString()}
|
key={i.toString()}
|
||||||
className="flex items-center justify-between p-3 bg-muted/50 rounded"
|
className="flex items-center justify-between p-3 bg-muted/50 rounded"
|
||||||
>
|
>
|
||||||
<div className="h-4 w-24 bg-muted animate-pulse rounded" />
|
<div className="h-4 w-20 bg-muted animate-pulse rounded" />
|
||||||
<div className="h-4 w-32 bg-muted animate-pulse rounded" />
|
<div className="h-4 w-28 bg-muted animate-pulse rounded" />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* Information skeleton */}
|
{/* Chart skeleton */}
|
||||||
<section>
|
<section>
|
||||||
<div className="mb-2 flex justify-between font-medium">
|
<div className="mb-2 flex justify-between font-medium">
|
||||||
<div className="h-5 w-24 bg-muted animate-pulse rounded" />
|
<div className="h-5 w-40 bg-muted animate-pulse rounded" />
|
||||||
</div>
|
<div className="h-4 w-16 bg-muted animate-pulse rounded" />
|
||||||
<div className="space-y-2">
|
</div>
|
||||||
{Array.from({ length: 6 }).map((_, i) => (
|
<div className="card p-4">
|
||||||
<div
|
<div className="h-32 w-full bg-muted animate-pulse rounded" />
|
||||||
key={i.toString()}
|
</div>
|
||||||
className="flex items-center justify-between p-3 bg-muted/50 rounded"
|
</section>
|
||||||
>
|
</WidgetBody>
|
||||||
<div className="h-4 w-20 bg-muted animate-pulse rounded" />
|
</>
|
||||||
<div className="h-4 w-28 bg-muted animate-pulse rounded" />
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* Chart skeleton */}
|
|
||||||
<section>
|
|
||||||
<div className="mb-2 flex justify-between font-medium">
|
|
||||||
<div className="h-5 w-40 bg-muted animate-pulse rounded" />
|
|
||||||
<div className="h-4 w-16 bg-muted animate-pulse rounded" />
|
|
||||||
</div>
|
|
||||||
<div className="card p-4">
|
|
||||||
<div className="h-32 w-full bg-muted animate-pulse rounded" />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</WidgetBody>
|
|
||||||
</Widget>
|
|
||||||
</ModalContent>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ function Component() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-3 gap-4 p-8 pt-0">
|
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4 p-4 pt-4 md:p-8 md:pt-0">
|
||||||
<div>
|
<div>
|
||||||
<RealtimeGeo projectId={projectId} />
|
<RealtimeGeo projectId={projectId} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user