import {
AlertCircle,
CheckCircle2,
ExternalLink,
Globe,
XCircle,
} from "lucide-react";
import { MarkdownAnswer } from "@/client/features/ai-search/components/MarkdownAnswer";
import {
formatModelLabel,
getModelAccent,
} from "@/client/features/ai-search/platformLabels";
import { formatUrlForDisplay } from "@/client/features/ai-search/urlDisplay";
import type {
PromptExplorerModelResult,
PromptExplorerResult,
} from "@/types/schemas/ai-search";
type Props = {
result: PromptExplorerResult;
};
export function PromptExplorerResults({ result }: Props) {
return (
{result.results.map((modelResult) => (
))}
);
}
function ModelResultCard({
modelResult,
highlightBrand,
}: {
modelResult: PromptExplorerModelResult;
highlightBrand: string | null;
}) {
const accent = getModelAccent(modelResult.model);
if (modelResult.status === "error") {
return (
);
}
return (
{modelResult.citations.length > 0 ? (
Cited sources ({modelResult.citations.length})
) : null}
{modelResult.fanOutQueries.length > 0 ? (
Related queries the model considered
{modelResult.fanOutQueries.map((query, index) => (
{query}
))}
) : null}
);
}
function ModelHeader({
model,
modelName,
tokens,
webSearch,
brandMentioned,
highlightBrand,
status,
}: {
model: PromptExplorerModelResult["model"];
modelName: string | null;
tokens: number | null;
webSearch: boolean;
brandMentioned: boolean | null;
highlightBrand: string | null;
status: "success" | "error";
}) {
const accent = getModelAccent(model);
return (
);
}
function BrandMentionBadge({
mentioned,
highlightBrand,
}: {
mentioned: boolean | null;
highlightBrand: string | null;
}) {
if (mentioned == null || !highlightBrand) return null;
if (mentioned) {
return (
{highlightBrand}
);
}
return (
no {highlightBrand}
);
}