rename IServiceCreateEventPayload
This commit is contained in:
committed by
Carl-Gerhard Lindesvärd
parent
1b613538cc
commit
0fea45c9f7
@@ -4,7 +4,7 @@ import { Fragment } from 'react';
|
||||
import { Widget, WidgetHead } from '@/components/widget';
|
||||
import { isSameDay } from 'date-fns';
|
||||
|
||||
import type { IServiceCreateEventPayload } from '@openpanel/db';
|
||||
import type { IServiceEvent } from '@openpanel/db';
|
||||
|
||||
import { EventListItem } from '../event-list/event-list-item';
|
||||
|
||||
@@ -14,7 +14,7 @@ function showDateHeader(a: Date, b?: Date) {
|
||||
}
|
||||
|
||||
interface EventListProps {
|
||||
data: IServiceCreateEventPayload[];
|
||||
data: IServiceEvent[];
|
||||
}
|
||||
export function EventConversionsList({ data }: EventListProps) {
|
||||
return (
|
||||
@@ -28,7 +28,7 @@ export function EventConversionsList({ data }: EventListProps) {
|
||||
{showDateHeader(item.createdAt, list[index - 1]?.createdAt) && (
|
||||
<div className="flex flex-row justify-between gap-2 [&:not(:first-child)]:mt-12">
|
||||
<div className="flex gap-2">
|
||||
<div className="bg-def-200 border-def-200 flex h-8 items-center gap-2 rounded border px-3 text-sm font-medium leading-none">
|
||||
<div className="flex h-8 items-center gap-2 rounded border border-def-200 bg-def-200 px-3 text-sm font-medium leading-none">
|
||||
{item.createdAt.toLocaleDateString()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,12 +16,12 @@ import {
|
||||
} from '@/hooks/useEventQueryFilters';
|
||||
import { round } from 'mathjs';
|
||||
|
||||
import type { IServiceCreateEventPayload } from '@openpanel/db';
|
||||
import type { IServiceEvent } from '@openpanel/db';
|
||||
|
||||
import { EventEdit } from './event-edit';
|
||||
|
||||
interface Props {
|
||||
event: IServiceCreateEventPayload;
|
||||
event: IServiceEvent;
|
||||
open: boolean;
|
||||
setOpen: Dispatch<SetStateAction<boolean>>;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import { cn } from '@/utils/cn';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
import type { IServiceCreateEventPayload } from '@openpanel/db';
|
||||
import type { IServiceEvent } from '@openpanel/db';
|
||||
|
||||
import {
|
||||
EventIconColors,
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
} from './event-icon';
|
||||
|
||||
interface Props {
|
||||
event: IServiceCreateEventPayload;
|
||||
event: IServiceEvent;
|
||||
open: boolean;
|
||||
setOpen: Dispatch<SetStateAction<boolean>>;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ export function EventEdit({ event, open, setOpen }: Props) {
|
||||
setIcon(name);
|
||||
}}
|
||||
className={cn(
|
||||
'bg-def-200 inline-flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-md transition-all',
|
||||
'inline-flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-md bg-def-200 transition-all',
|
||||
name === selectedIcon
|
||||
? 'scale-110 ring-1 ring-black'
|
||||
: '[&_svg]:opacity-50'
|
||||
|
||||
@@ -9,15 +9,12 @@ import { cn } from '@/utils/cn';
|
||||
import { getProfileName } from '@/utils/getters';
|
||||
import Link from 'next/link';
|
||||
|
||||
import type {
|
||||
IServiceCreateEventPayload,
|
||||
IServiceEventMinimal,
|
||||
} from '@openpanel/db';
|
||||
import type { IServiceEvent, IServiceEventMinimal } from '@openpanel/db';
|
||||
|
||||
import { EventDetails } from './event-details';
|
||||
import { EventIcon } from './event-icon';
|
||||
|
||||
type EventListItemProps = IServiceEventMinimal | IServiceCreateEventPayload;
|
||||
type EventListItemProps = IServiceEventMinimal | IServiceEvent;
|
||||
|
||||
export function EventListItem(props: EventListItemProps) {
|
||||
const { organizationSlug, projectId } = useAppParams();
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
|
||||
import { isSameDay } from 'date-fns';
|
||||
import { GanttChartIcon } from 'lucide-react';
|
||||
|
||||
import type { IServiceCreateEventPayload } from '@openpanel/db';
|
||||
import type { IServiceEvent } from '@openpanel/db';
|
||||
|
||||
import { EventListItem } from './event-list-item';
|
||||
import EventListener from './event-listener';
|
||||
@@ -20,7 +20,7 @@ function showDateHeader(a: Date, b?: Date) {
|
||||
}
|
||||
|
||||
interface EventListProps {
|
||||
data: IServiceCreateEventPayload[];
|
||||
data: IServiceEvent[];
|
||||
count: number;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ function EventList({ data, count }: EventListProps) {
|
||||
<div className="flex flex-row justify-between gap-2 [&:not(:first-child)]:mt-12">
|
||||
{index === 0 ? <EventListener /> : <div />}
|
||||
<div className="flex gap-2">
|
||||
<div className="bg-def-200 border-def-200 flex h-8 items-center gap-2 rounded border px-3 text-sm font-medium leading-none">
|
||||
<div className="flex h-8 items-center gap-2 rounded border border-def-200 bg-def-200 px-3 text-sm font-medium leading-none">
|
||||
{item.createdAt.toLocaleDateString()}
|
||||
</div>
|
||||
{index === 0 && (
|
||||
|
||||
@@ -5,20 +5,17 @@ import { EventListItem } from '@/app/(app)/[organizationSlug]/[projectId]/events
|
||||
import useWS from '@/hooks/useWS';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
|
||||
import type {
|
||||
IServiceCreateEventPayload,
|
||||
IServiceEventMinimal,
|
||||
} from '@openpanel/db';
|
||||
import type { IServiceEvent, IServiceEventMinimal } from '@openpanel/db';
|
||||
|
||||
type Props = {
|
||||
events: (IServiceEventMinimal | IServiceCreateEventPayload)[];
|
||||
events: (IServiceEventMinimal | IServiceEvent)[];
|
||||
projectId: string;
|
||||
limit: number;
|
||||
};
|
||||
|
||||
const RealtimeLiveEvents = ({ events, projectId, limit }: Props) => {
|
||||
const [state, setState] = useState(events ?? []);
|
||||
useWS<IServiceEventMinimal | IServiceCreateEventPayload>(
|
||||
useWS<IServiceEventMinimal | IServiceEvent>(
|
||||
`/live/events/${projectId}`,
|
||||
(event) => {
|
||||
setState((p) => [event, ...p].slice(0, limit));
|
||||
|
||||
@@ -10,22 +10,20 @@ import { CheckCircle2Icon, CheckIcon, Loader2 } from 'lucide-react';
|
||||
|
||||
import type {
|
||||
IServiceClient,
|
||||
IServiceCreateEventPayload,
|
||||
IServiceEvent,
|
||||
IServiceProject,
|
||||
} from '@openpanel/db';
|
||||
|
||||
type Props = {
|
||||
project: IServiceProject;
|
||||
client: IServiceClient | null;
|
||||
events: IServiceCreateEventPayload[];
|
||||
events: IServiceEvent[];
|
||||
onVerified: (verified: boolean) => void;
|
||||
};
|
||||
|
||||
const VerifyListener = ({ client, events: _events, onVerified }: Props) => {
|
||||
const [events, setEvents] = useState<IServiceCreateEventPayload[]>(
|
||||
_events ?? []
|
||||
);
|
||||
useWS<IServiceCreateEventPayload>(
|
||||
const [events, setEvents] = useState<IServiceEvent[]>(_events ?? []);
|
||||
useWS<IServiceEvent>(
|
||||
`/live/events/${client?.projectId}?type=received`,
|
||||
(data) => {
|
||||
setEvents((prev) => [...prev, data]);
|
||||
|
||||
@@ -6,10 +6,7 @@ import { LinkButton } from '@/components/ui/button';
|
||||
import { cn } from '@/utils/cn';
|
||||
import Link from 'next/link';
|
||||
|
||||
import type {
|
||||
IServiceCreateEventPayload,
|
||||
IServiceProjectWithClients,
|
||||
} from '@openpanel/db';
|
||||
import type { IServiceEvent, IServiceProjectWithClients } from '@openpanel/db';
|
||||
|
||||
import OnboardingLayout, {
|
||||
OnboardingDescription,
|
||||
@@ -18,7 +15,7 @@ import VerifyListener from './onboarding-verify-listener';
|
||||
|
||||
type Props = {
|
||||
project: IServiceProjectWithClients;
|
||||
events: IServiceCreateEventPayload[];
|
||||
events: IServiceEvent[];
|
||||
};
|
||||
|
||||
const Verify = ({ project, events }: Props) => {
|
||||
|
||||
Reference in New Issue
Block a user