import { SidePanelProps } from '@wix/design-system';
import { useWixPatternsContainer } from '@wix/bex-core/react';

export function useSidePanelProps({
  onClose,
}: {
  onClose?: () => void;
}): Partial<SidePanelProps> {
  const { isPanelLayout } = useWixPatternsContainer();

  if (isPanelLayout) {
    return {
      onBackButtonClick: onClose,
    };
  }

  return {
    onCloseButtonClick: onClose,
  };
}
