import React, { useEffect, useState, useCallback } from "react"; import { useClient, useFormValue, PatchEvent, set } from "sanity"; import { Stack, Card, Flex, Text, Box, useTheme, Badge, Button } from "@sanity/ui"; import useProEnabled from "../../hooks/useProEnabled"; import ProGate from "./ProGate"; import CheckCircleIcon from "../icons/CheckCircleIcon"; import AlertCircleIcon from "../icons/AlertCircleIcon"; import ProgressRing from "../icons/ProgressRing"; /* eslint-disable @typescript-eslint/no-explicit-any */ interface CheckResult { key: string; label: string; pass: boolean; description?: string; onFix?: () => void; fixLabel?: string; fixHint?: string; } const CheckRow = ({ check, justFixed, isDarkMode, }: { check: CheckResult; justFixed: boolean; isDarkMode: boolean; }) => { const passColor = "#10b981"; const hasDescription = !check.pass && !justFixed && (check.description || check.fixHint); const showFixButton = !check.pass && !justFixed && check.onFix && check.fixLabel; const hasSecondary = hasDescription || showFixButton; let Icon = ( ); if (check.pass || justFixed) { Icon = ( ); } return ( {Icon} {check.label} {justFixed && ( Fixed! )} {!check.pass && !justFixed && check.description && ( {check.description} )} {!check.pass && !justFixed && check.fixHint && ( {check.fixHint} )} {!check.pass && !justFixed && check.onFix && check.fixLabel && (