diff --git a/src/renderer/components/company-onboarding/CompanyStep.tsx b/src/renderer/components/company-onboarding/CompanyStep.tsx index 5e4f95ab..a8122482 100644 --- a/src/renderer/components/company-onboarding/CompanyStep.tsx +++ b/src/renderer/components/company-onboarding/CompanyStep.tsx @@ -1,8 +1,7 @@ -import { motion } from "framer-motion"; import { Buildings, FolderOpen } from "@phosphor-icons/react"; import type { ConnectorId } from "@shared/types"; import { ActionButton, Input, TextArea, Select } from "../ui"; -import { getStepNumber, TOTAL_STEPS } from "./OnboardingHero"; +import { OnboardingStep } from "./OnboardingStep"; import { useOnboarding } from "./OnboardingContext"; interface CompanyStepProps { @@ -32,22 +31,11 @@ export function CompanyStep({ onContinue, onBack }: CompanyStepProps) { } = useOnboarding(); return ( - -
- {t("onboarding.stepLabelCompany")} {getStepNumber("company")} / {TOTAL_STEPS} -
-
- {t("onboarding.step1Title")} -
-
-
- + ); } diff --git a/src/renderer/components/company-onboarding/ExecutionModeStep.tsx b/src/renderer/components/company-onboarding/ExecutionModeStep.tsx index 12953e2a..82842f3d 100644 --- a/src/renderer/components/company-onboarding/ExecutionModeStep.tsx +++ b/src/renderer/components/company-onboarding/ExecutionModeStep.tsx @@ -1,6 +1,5 @@ -import { motion } from "framer-motion"; import { ArrowRight, Brain, UserCircle, type Icon } from "@phosphor-icons/react"; -import { getStepNumber, TOTAL_STEPS } from "./OnboardingHero"; +import { OnboardingStep } from "./OnboardingStep"; import { useOnboarding } from "./OnboardingContext"; interface ExecutionModeStepProps { @@ -12,22 +11,11 @@ export function ExecutionModeStep({ onContinue, onBack }: ExecutionModeStepProps const { executionMode, setExecutionMode, t } = useOnboarding(); return ( - -
- {t("onboarding.stepLabelMode")} {getStepNumber("executionmode")} / {TOTAL_STEPS} -
-
- {t("onboarding.modeStepTitle")} -
-
-
- + ); } diff --git a/src/renderer/components/company-onboarding/ModelPoolStep.tsx b/src/renderer/components/company-onboarding/ModelPoolStep.tsx index 89f6343a..4899c837 100644 --- a/src/renderer/components/company-onboarding/ModelPoolStep.tsx +++ b/src/renderer/components/company-onboarding/ModelPoolStep.tsx @@ -1,7 +1,6 @@ -import { motion } from "framer-motion"; import { ActionButton } from "../ui"; import { ModelToggleList, StatusBadge } from "../execution/ModelManagementShared"; -import { getStepNumber, TOTAL_STEPS } from "./OnboardingHero"; +import { OnboardingStep } from "./OnboardingStep"; import { useOnboarding } from "./OnboardingContext"; interface ModelPoolStepProps { @@ -31,25 +30,12 @@ export function ModelPoolStep({ onBack, onContinue }: ModelPoolStepProps) { : t("onboarding.modelPoolContinueHint"); return ( - -
- {t("onboarding.stepLabelModelPool")} {getStepNumber("modelpool")} / {TOTAL_STEPS} -
-
- {t("onboarding.modelPoolStepTitle")} -
-
- {t("onboarding.modelPoolStepSubtitle")} -
-
-
{t("onboarding.modelPoolStepDescription")}
@@ -113,6 +99,6 @@ export function ModelPoolStep({ onBack, onContinue }: ModelPoolStepProps) { disabled={!canContinue} />
-
+ ); } diff --git a/src/renderer/components/company-onboarding/NodeCheckStep.tsx b/src/renderer/components/company-onboarding/NodeCheckStep.tsx index a91506f7..2d01e11a 100644 --- a/src/renderer/components/company-onboarding/NodeCheckStep.tsx +++ b/src/renderer/components/company-onboarding/NodeCheckStep.tsx @@ -1,4 +1,3 @@ -import { motion } from "framer-motion"; import { CheckCircle, XCircle, @@ -8,7 +7,7 @@ import { } from "@phosphor-icons/react"; import { ActionButton } from "../ui"; import type { TerminalCommandKey } from "@shared/contracts"; -import { getStepNumber, TOTAL_STEPS } from "./OnboardingHero"; +import { OnboardingStep } from "./OnboardingStep"; import { useOnboarding } from "./OnboardingContext"; interface NodeCheckStepProps { @@ -50,22 +49,11 @@ export function NodeCheckStep({ onContinue, onBack }: NodeCheckStepProps) { const platformInfo = INSTALL_COMMANDS[platform] ?? INSTALL_COMMANDS.linux; return ( - -
- {t("onboarding.stepLabel1")} {getStepNumber("nodecheck")} / {TOTAL_STEPS} — {t("onboarding.nodeCheckStep")} -
-
- {t("onboarding.nodeCheckTitle")} -
-
- {/* Status */}
{nodeChecking ? ( @@ -132,6 +120,6 @@ export function NodeCheckStep({ onContinue, onBack }: NodeCheckStepProps) { disabled={!nodeStatus?.installed} />
- + ); } diff --git a/src/renderer/components/company-onboarding/OnboardingStep.tsx b/src/renderer/components/company-onboarding/OnboardingStep.tsx new file mode 100644 index 00000000..f1bbe900 --- /dev/null +++ b/src/renderer/components/company-onboarding/OnboardingStep.tsx @@ -0,0 +1,36 @@ +import { motion } from "framer-motion"; +import type { ReactNode } from "react"; +import { getStepNumber, TOTAL_STEPS, type OnboardingStepName } from "./OnboardingHero"; + +interface OnboardingStepProps { + step: OnboardingStepName; + eyebrow: string; + title: string; + subtitle?: ReactNode; + children: ReactNode; +} + +export function OnboardingStep({ step, eyebrow, title, subtitle, children }: OnboardingStepProps) { + return ( + +
+ {eyebrow} {getStepNumber(step)} / {TOTAL_STEPS} +
+
+ {title} +
+ {subtitle ? ( +
{subtitle}
+ ) : null} +
+ {children} + + ); +} diff --git a/src/renderer/components/company-onboarding/ProvidersStep.tsx b/src/renderer/components/company-onboarding/ProvidersStep.tsx index 1f05f00a..54a8e654 100644 --- a/src/renderer/components/company-onboarding/ProvidersStep.tsx +++ b/src/renderer/components/company-onboarding/ProvidersStep.tsx @@ -1,5 +1,4 @@ import { useState } from "react"; -import { motion } from "framer-motion"; import { ArrowRight, FloppyDisk, SignIn } from "@phosphor-icons/react"; import { ActionButton } from "../ui"; import { @@ -9,7 +8,7 @@ import { StatusBadge, INPUT_CLS, } from "./ProvidersStepShared"; -import { getStepNumber, TOTAL_STEPS } from "./OnboardingHero"; +import { OnboardingStep } from "./OnboardingStep"; import { useOnboarding } from "./OnboardingContext"; /* ------------------------------------------------------------------ */ @@ -87,24 +86,12 @@ export function ProvidersStep({ onContinue, onBack }: ProvidersStepProps) { } return ( - -
- {t("onboarding.stepLabelProviders")} {getStepNumber("providers")} / {TOTAL_STEPS} -
-
- {t("onboarding.providersTitle")} -
-
- {t("onboarding.providersSubtitle")} -
-
{/* ---- Card 1: Claude Code (Official) ---- */} @@ -281,6 +268,6 @@ export function ProvidersStep({ onContinue, onBack }: ProvidersStepProps) { />
-
+ ); }