move wildcard info to inline blue hint below origin input

Co-Authored-By: mantra <mantra@stack-auth.com>
This commit is contained in:
Devin AI 2026-06-16 21:19:05 +00:00
parent 4288fa4716
commit 5e12e98884

View File

@ -18,14 +18,13 @@ import {
Typography,
} from "@/components/ui";
import { DesignAnalyticsCard } from "@/components/design-components/analytics-card";
import { DesignAlert } from "@/components/design-components/alert";
import { useRouter } from "@/components/router";
import type { AnalyticsClickmapTokenResponse } from "@hexclave/shared/dist/interface/admin-metrics";
import {
CLICKMAP_OVERLAY_TOKEN_STORAGE_KEY,
CLICKMAP_OVERLAY_TOKEN_UPDATED_EVENT,
} from "@hexclave/shared/dist/utils/analytics-clickmap-overlay";
import { ArrowRight, GlobeHemisphereWest } from "@phosphor-icons/react";
import { ArrowRight, GlobeHemisphereWest, InfoIcon } from "@phosphor-icons/react";
import { useEffect, useMemo, useState } from "react";
import { getClickmapOriginOptions, normalizeClickmapOrigin, type ClickmapOrigin } from "./clickmap-origins";
@ -150,6 +149,14 @@ export default function PageClient() {
Use the exact origin shown in the browser address bar, including for domains matched by a wildcard.
</Typography>
<Input value={customOrigin} onChange={(event) => setCustomOrigin(event.target.value)} placeholder="https://app.example.com" />
{wildcardDomains.length > 0 && (
<div className="flex items-start gap-1.5 text-xs text-blue-600 dark:text-blue-400">
<InfoIcon className="h-3.5 w-3.5 shrink-0 mt-0.5" />
<span>
{wildcardDomains.map((d) => d.baseUrl).join(", ")} can match real pages, but cannot be opened directly as a clickmap target.
</span>
</div>
)}
</div>
<Button
className="gap-1.5"
@ -210,14 +217,6 @@ export default function PageClient() {
</DesignAnalyticsCard>
)}
{wildcardDomains.length > 0 && (
<DesignAlert
variant="info"
title="Wildcard domains need an exact origin"
description={`Enter the concrete site origin above. ${wildcardDomains.map((domain) => domain.baseUrl).join(", ")} can match real pages, but cannot be opened directly as a clickmap target.`}
/>
)}
<ClickmapTokenDialog
origin={selectedOrigin}
token={token}