import React from 'react'; import { Box, Text, Button, TextButton, Badge, Divider, Tooltip, } from '@wix/design-system'; import { SetupWidgetStep } from '@wix/bex-core'; import { useWixPatternsContainer } from '@wix/bex-core/react'; import { SetupStepIcon } from './SetupStepIcon'; import { st, classes } from './SetupWidget.st.css.js'; export interface SetupStepRowProps { step: SetupWidgetStep; /** Highlighted + bold row (the recommended (primary) or expanded step). */ isFocused: boolean; /** Inline content is shown below the row. */ expanded: boolean; onActivate: () => void; /** Supplies the inline-expansion content (render prop on the widget). */ renderStepContent?: (step: SetupWidgetStep) => React.ReactNode; } /** * Desktop step row. Recreated from the existing Setup widget: * - completed → green check, struck-through title, optional completed CTA * - disabled → muted bullet + disabled CTA (permission-denied) * - in-progress → "In progress" badge next to the title * - focused → blue surface, bold title, primary CTA * - hoverable rows tint blue on hover (handled in Stylable) */ export const SetupStepRow = ({ step, isFocused, expanded, onActivate, renderStepContent, }: SetupStepRowProps) => { const { translate: t } = useWixPatternsContainer(); const isInProgress = step.status === 'in-progress'; const isCompleted = step.status === 'completed'; const isDisabled = step.status === 'disabled'; const isInlineExpanded = expanded && step.expansionMode === 'inline'; const showCta = !isCompleted && !!step.ctaLabel && !isInlineExpanded; // Completed steps stay actionable when they carry a completed CTA (G2). const showCompletedCta = isCompleted && !!step.completedCtaLabel && !isDisabled; const clickable = (!isCompleted && !isDisabled) || showCompletedCta; const hoverable = !isFocused && !isCompleted && !isDisabled; const handleClick = clickable ? onActivate : undefined; return (