* refactor: apply biome formatting to apps/web (batch 1) Formats apps/web non-modules directories: - apps/web/app - apps/web/lib - apps/web/pages - apps/web/styles - apps/web/server - apps/web/test - Root-level .ts and .mjs files Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/modules (batch 2) Formats smaller apps/web/modules directories: - onboarding, data-table, users, apps, auth - integration-attribute-sync, shell, availability - feature-flags, team, webhooks, getting-started - feature-opt-in, troubleshooter, schedules, notifications - signup-view.tsx Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/modules (batch 3) Formats medium apps/web/modules directories: - bookings - event-types - insights - embed Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/modules/ee (batch 4) Formats apps/web/modules/ee directory. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web (batch 5) Formats remaining apps/web directories: - apps/web/modules/settings - apps/web/modules/booking-audit - apps/web/playwright Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/components (batch 6) Formats remaining apps/web/components files. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to new apps/web files from main Formats newly added/modified files from main merge: - WorkflowStepContainer.tsx (resolved merge conflicts) - Newly moved files (blocklist, form-builder, schedules, etc.) - Other files modified in main Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to new apps/web files from main Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
84 lines
3.3 KiB
TypeScript
84 lines
3.3 KiB
TypeScript
"use client";
|
|
|
|
import dayjs from "@calcom/dayjs";
|
|
import { DomainIcon } from "@calcom/features/routing-trace/components/DomainIcon";
|
|
import { getDomainLabel } from "@calcom/features/routing-trace/presenters/getDomainLabel";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { trpc } from "@calcom/trpc/react";
|
|
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetBody } from "@calcom/ui/components/sheet";
|
|
|
|
interface RoutingTraceSheetProps {
|
|
isOpen: boolean;
|
|
setIsOpen: (open: boolean) => void;
|
|
bookingUid: string;
|
|
}
|
|
|
|
export function RoutingTraceSheet({ isOpen, setIsOpen, bookingUid }: RoutingTraceSheetProps) {
|
|
const { t } = useLocale();
|
|
|
|
const { data, isLoading } = trpc.viewer.bookings.getRoutingTrace.useQuery(
|
|
{ bookingUid },
|
|
{
|
|
enabled: isOpen,
|
|
staleTime: 10 * 60 * 1000,
|
|
}
|
|
);
|
|
|
|
return (
|
|
<Sheet open={isOpen} onOpenChange={setIsOpen}>
|
|
<SheetContent>
|
|
<SheetHeader>
|
|
<SheetTitle>{t("routing_trace")}</SheetTitle>
|
|
</SheetHeader>
|
|
<SheetBody>
|
|
{isLoading && (
|
|
<div className="flex flex-col gap-4 py-2">
|
|
{[1, 2, 3].map((i) => (
|
|
<div key={i} className="flex gap-3">
|
|
<div className="bg-muted h-8 w-8 animate-pulse rounded-full" />
|
|
<div className="flex flex-1 flex-col gap-1.5">
|
|
<div className="bg-muted h-3 w-24 animate-pulse rounded" />
|
|
<div className="bg-muted h-4 w-full animate-pulse rounded" />
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
)}
|
|
{!isLoading && !data?.steps?.length && (
|
|
<p className="text-subtle text-sm">{t("no_results_found")}</p>
|
|
)}
|
|
{!isLoading && data?.steps && data.steps.length > 0 && (
|
|
<div className="relative flex flex-col">
|
|
{data.steps.map((step, idx) => {
|
|
const isLast = idx === data.steps.length - 1;
|
|
return (
|
|
<div key={idx} className="relative flex gap-3 pb-6 last:pb-0">
|
|
{/* Timeline connector line */}
|
|
{!isLast && <div className="border-subtle absolute left-4 top-8 bottom-0 border-l" />}
|
|
{/* Icon circle */}
|
|
<div className="bg-default border-subtle relative z-10 flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full border">
|
|
<DomainIcon domain={step.domain} />
|
|
</div>
|
|
{/* Content */}
|
|
<div className="flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5">
|
|
<div className="flex items-center gap-2">
|
|
<span className="bg-subtle text-subtle rounded px-1.5 py-0.5 text-xs font-medium">
|
|
{getDomainLabel(step.domain)}
|
|
</span>
|
|
<span className="text-muted text-xs">
|
|
{dayjs(step.timestamp).format("h:mm:ss.SSS A")}
|
|
</span>
|
|
</div>
|
|
<p className="text-emphasis text-sm">{step.message}</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
)}
|
|
</SheetBody>
|
|
</SheetContent>
|
|
</Sheet>
|
|
);
|
|
}
|