import React from 'react';
import { Card as CardPrimitive, CardProps as CardPropsPrimitive } from '@modulz/primitives';

export type CardProps = CardPropsPrimitive & {
  variant?: 'border' | 'ghost';
}

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

export const Card = React.forwardRef<PrimitiveRefType, CardProps>((props, ref) => {
  return (
    <CardPrimitive {...props} ref={ref}  styleConfig={{"base":{"card":{"normal":{"paddingRight":"24px","borderTopLeftRadius":"4px","backgroundColor":"hsl(0, 0%, 100%)","borderTopRightRadius":"4px","paddingBottom":"24px","paddingTop":"24px","boxShadow":"0px 3px 10px 0 hsla(210, 8%, 5%, 0.1)","borderBottomLeftRadius":"4px","borderBottomRightRadius":"4px","paddingLeft":"24px"}}},"variants":{"variant":{"border":{"card":{"normal":{"border":"1px solid","borderColor":"rgba(226, 229, 233, 1)","boxShadow":"none"}}},"ghost":{"card":{"normal":{"boxShadow":"none"}}}}}}}/>
  );
});


