Skip to content

Commit

Permalink
Fix boxedExpressionStoriesWrapper.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
jomarko committed Dec 16, 2024
1 parent f1f356e commit 7ce7cdc
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ type StorybookArgWidhtsById = Record<string, number[]>;
export type BoxedExpressionEditorStoryArgs = Omit<BoxedExpressionEditorProps, "widthsById" | "onWidthsChange"> & {
widthsById?: Record<string, number[]>;
onWidthsChange?: React.Dispatch<React.SetStateAction<Record<string, number[]>>>;
evaluationHitsCountById?: Map<string, number>;
};

export function BoxedExpressionEditorStory(props?: Partial<BoxedExpressionEditorStoryArgs>) {
Expand All @@ -96,7 +95,6 @@ export function BoxedExpressionEditorStory(props?: Partial<BoxedExpressionEditor
const [expressionState, setExpressionState] = useState<Normalized<BoxedExpression> | undefined>(
args?.expression ?? props?.expression
);
const [evaluationHitsCountById, setEvaluationHitsCountById] = useState(props?.evaluationHitsCountById);

const [widthsByIdState, setWidthsByIdState] = useState<StorybookArgWidhtsById>(
args.widthsById ?? props?.widthsById ?? {}
Expand Down Expand Up @@ -177,7 +175,7 @@ export function BoxedExpressionEditorStory(props?: Partial<BoxedExpressionEditor
}
expressionHolderTypeRef={props?.expressionHolderTypeRef ?? args?.expressionHolderTypeRef}
expression={expressionState}
evaluationHitsCountById={evaluationHitsCountById}
evaluationHitsCountById={props?.evaluationHitsCountById ?? args?.evaluationHitsCountById}
onExpressionChange={setExpressionState}
onWidthsChange={onWidthsChange}
dataTypes={props?.dataTypes ?? args?.dataTypes ?? dataTypes}
Expand Down

0 comments on commit 7ce7cdc

Please sign in to comment.