Skip to content

Commit

Permalink
refactor: DecoratorType を使用する
Browse files Browse the repository at this point in the history
  • Loading branch information
schktjm committed Oct 8, 2024
1 parent 0c6e6ef commit 846cd41
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/smarthr-ui/src/components/Dialog/useStepDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Button } from '../Button'

import { FocusTrapRef } from './FocusTrap'

import type { DecoratorType } from '../../types'

const NEXT_BUTTON_LABEL = '次へ'

export const useStepDialog = (children: ReactNode) => {
Expand All @@ -18,11 +20,7 @@ export const useStepDialog = (children: ReactNode) => {
return steps
}, [children])

/** nextButtonLabel の型は DecoratorType に合わせている */
const getActionText = (
submitActionText: ReactNode,
nextButtonLabel?: (text: string) => ReactNode,
) =>
const getActionText = (submitActionText: ReactNode, nextButtonLabel?: DecoratorType) =>
activeStep < childrenSteps.length - 1
? nextButtonLabel
? nextButtonLabel(NEXT_BUTTON_LABEL)
Expand Down

0 comments on commit 846cd41

Please sign in to comment.