diff --git a/apps/web/src/components/pullRequest/PullRequestLinkPreview.tsx b/apps/web/src/components/pullRequest/PullRequestLinkPreview.tsx index 76aaebbf62d18704e019eb38e79374bd424516bd..3f183b264b2beac50b5b998a8a8d80a647d70f84 100644 --- a/apps/web/src/components/pullRequest/PullRequestLinkPreview.tsx +++ b/apps/web/src/components/pullRequest/PullRequestLinkPreview.tsx @@ -15,6 +15,7 @@ import { useAtomQueryRunner } from "~/state/use-atom-query-runner"; import { useEnvironmentQuery } from "~/state/query"; import { PreviewCard, PreviewCardPopup, PreviewCardTrigger } from "../ui/preview-card"; +import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import { PullRequestActorAvatar, resolvePullRequestState } from "./pullRequestPresentation"; interface PullRequestLinkPreviewTarget { @@ -81,6 +82,8 @@ export function PullRequestLinkPreview({ }) : link; const detail = detailQuery.data; + const showCard = detail !== null || (detailQuery.error !== null && fallback !== undefined); + const showUrlTooltip = open && detailQuery.error !== null && !showCard; const state = detail === null ? null @@ -94,16 +97,19 @@ export function PullRequestLinkPreview({ return ( - - {detail !== null || detailQuery.error !== null ? ( + + } + delay={350} + closeDelay={120} + /> + {originalUrl} + + {showCard ? (
{detail === null ? ( - (fallback ?? ( -

- {originalUrl} -

- )) + fallback ) : (