import { RadioGroup, RadioGroupProps } from '@wix/design-system';
import React, { Children, ReactNode } from 'react';

export interface RadioGroupSafeProps extends RadioGroupProps {
  children?: ReactNode;
}

// https://wix.slack.com/archives/C39FTGUBZ/p1657020509840969
export function RadioGroupSafe(props: RadioGroupSafeProps) {
  return (
    <RadioGroup
      {...props}
      children={Children.toArray(props.children).filter(Boolean)}
    />
  );
}
