Skip to content

Commit

Permalink
fix(rating): fixing the storybook for custom segment
Browse files Browse the repository at this point in the history
  • Loading branch information
macci001 committed Oct 16, 2024
1 parent 10a817b commit 857f753
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/components/rating/src/rating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ const Rating = forwardRef<"div", RatingProps>((props, ref) => {
} = context;

const IconList = useMemo(() => {
if (children) {
return <div {...getIconWrapperProps()}>{children}</div>;
}

return (
<div {...getIconWrapperProps()}>
<RadioGroup
Expand Down Expand Up @@ -66,9 +62,10 @@ const Rating = forwardRef<"div", RatingProps>((props, ref) => {
onBlur={onBlur}
onChange={onChange}
/>
{Array.from(Array(length)).map((_, idx) => (
<RatingSegment key={"segment-" + idx} index={idx} />
))}
{children ??
Array.from(Array(length)).map((_, idx) => (
<RatingSegment key={"segment-" + idx} index={idx} />
))}
</RadioGroup>
</div>
);
Expand Down

0 comments on commit 857f753

Please sign in to comment.