import React from 'react';
import { Popover as PopoverPrimitive, PopoverProps as PopoverPropsPrimitive } from '@modulz/primitives';

export type PopoverProps = PopoverPropsPrimitive

type ExtractRefType<TypesThatMayContainReactRef> = TypesThatMayContainReactRef extends {ref?: React.Ref<infer T>} ? T : any;
type PrimitiveRefType = ExtractRefType<PopoverPropsPrimitive>  

export const Popover = React.forwardRef<PrimitiveRefType, PopoverProps>((props, ref) => {
  return (
    <PopoverPrimitive {...props} ref={ref}  alignOffset={0} arrowOffset={10} collisionTolerance={0} noArrow={false} sideOffset={-5} styleConfig={{"base":{"content":{"normal":{"paddingTop":"8px","borderTopLeftRadius":"8px","paddingLeft":"8px","boxShadow":"0 2px 5px 0 rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.15)","paddingBottom":"8px","borderTopRightRadius":"8px","borderBottomLeftRadius":"8px","height":"128px","backgroundColor":"hsl(0, 0%, 100%)","borderBottomRightRadius":"8px","width":"256px","paddingRight":"8px"}},"arrow":{"normal":{"width":"16px","height":"8px","fill":"hsl(0, 0%, 100%)"}}},"variants":{}}}/>
  );
});


