import { AlertTriangle, Archive, Check, Fingerprint, LockKeyhole, Orbit, RefreshCw, ShieldCheck, Sparkles, Users, } from "lucide-react"; import { useBuildsViewModel } from "./hooks/useBuildsViewModel"; import type { BuildsViewProps } from "./types"; import { useI18n } from "../../i18n"; import { getBuildCopy } from "./buildsCopy"; export function BuildsView({ snapshot, onOpenInventory }: BuildsViewProps) { const { locale } = useI18n(); const copy = getBuildCopy(locale); const { artifactCount, hasScanData, foundationLabel, foundationDetail, contractLabel, contractDetail, profileLabel, profileDetail, nativeResultCount, isLoadingBuildFit, buildFitLoadError, ranking, aggregateContextFields, setAggregateContextDraft, refreshBuildFit, } = useBuildsViewModel({ snapshot, locale }); const suggestions = ranking.suggestions; const hasSuggestions = suggestions.length > 0; return (

{hasSuggestions ? copy.heroReadyTitle : copy.heroEmptyTitle}

{hasSuggestions ? copy.heroReadyDescription : copy.heroEmptyDescription}

{hasSuggestions ?
{hasSuggestions ? copy.suggestionCount(suggestions.length) : copy.noSuggestionTitle} {hasSuggestions ? copy.nativeChecked(nativeResultCount) : copy.blockedDetail}
{hasScanData ? : }

{copy.stageArtifacts}

{foundationLabel} {foundationDetail}

{copy.stageContract}

{contractLabel} {contractDetail}

{copy.stageProfiles}

{profileLabel} {profileDetail}
{isLoadingBuildFit ? (
) : buildFitLoadError ? (
) : hasSuggestions ? (
{suggestions.map((suggestion) => (
{suggestion.characterName}

{suggestion.targetLabel}

{suggestion.evidenceCoverage}% {copy.coverageLabel}

{suggestion.targetDescription}

    {suggestion.artifacts.map((artifact) => (
  • {slotLabel(artifact.slot, copy)} {artifact.name} {artifact.setName} · {artifact.mainStat} {artifact.mainValue}
  • ))}
    {suggestion.reasons.map((reason) =>
  • {reason}
  • )}
{suggestion.warnings.length > 0 ? (
) : null}

{copy.sourceNote} {suggestion.sourceLabels.join(" · ")}. {copy.sourceDisclaimer}

))}
) : (
)} {aggregateContextFields.length > 0 ? (
{aggregateContextFields.map((field) => (
{field.characterName} · {field.targetLabel} {copy.outsideArtifacts(field.stat, targetRangeLabel(field, copy))} {field.reason}
{field.error || copy.contextPending}
))}
) : null}
); } function slotLabel(slot: string, copy: ReturnType) { return copy.slots[slot] ?? slot; } function deferredLabel(reason: string, copy: ReturnType) { return copy.deferredReasons[reason] ?? copy.deferredFallback; } function targetRangeLabel(field: { minimum?: number; maximum?: number; unit: "flat" | "percent" }, copy: ReturnType) { const unit = field.unit === "percent" ? "%" : ""; if (field.minimum !== undefined && field.maximum !== undefined) return `(${field.minimum}${unit}–${field.maximum}${unit})`; if (field.minimum !== undefined) return copy.rangeAtLeast(field.minimum, unit); if (field.maximum !== undefined) return copy.rangeAtMost(field.maximum, unit); return ""; }