mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import React, { type ReactNode } from 'react'
|
|
import type { Theme } from '../../utils/theme.js'
|
|
import { Dialog } from '../design-system/Dialog.js'
|
|
import { useWizard } from './useWizard.js'
|
|
import { WizardNavigationFooter } from './WizardNavigationFooter.js'
|
|
|
|
type Props = {
|
|
title?: string
|
|
color?: keyof Theme
|
|
children: ReactNode
|
|
subtitle?: string
|
|
footerText?: ReactNode
|
|
}
|
|
|
|
export function WizardDialogLayout({
|
|
title: titleOverride,
|
|
color = 'suggestion',
|
|
children,
|
|
subtitle,
|
|
footerText,
|
|
}: Props): ReactNode {
|
|
const {
|
|
currentStepIndex,
|
|
totalSteps,
|
|
title: providerTitle,
|
|
showStepCounter,
|
|
goBack,
|
|
} = useWizard()
|
|
const title = titleOverride || providerTitle || 'Wizard'
|
|
const stepSuffix =
|
|
showStepCounter !== false ? ` (${currentStepIndex + 1}/${totalSteps})` : ''
|
|
|
|
return (
|
|
<>
|
|
<Dialog
|
|
title={`${title}${stepSuffix}`}
|
|
subtitle={subtitle}
|
|
onCancel={goBack}
|
|
color={color}
|
|
hideInputGuide
|
|
isCancelActive={false}
|
|
>
|
|
{children}
|
|
</Dialog>
|
|
<WizardNavigationFooter instructions={footerText} />
|
|
</>
|
|
)
|
|
}
|