import React from 'react';
import { Alert as AlertPrimitive, AlertProps as AlertPropsPrimitive } from '@modulz/primitives';

export type AlertProps = AlertPropsPrimitive & {
  variant?: 'red' | 'yellow' | 'blue' | 'green';
}

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

export const Alert = React.forwardRef<PrimitiveRefType, AlertProps>((props, ref) => {
  return (
    <AlertPrimitive {...props} ref={ref}  styleConfig={{"base":{"alert":{"normal":{"borderBottomRightRadius":"4px","paddingBottom":"16px","borderBottomLeftRadius":"4px","paddingRight":"16px","border":"1px solid","borderColor":"rgba(226, 229, 233, 1)","borderTopRightRadius":"4px","backgroundColor":"hsl(0, 0%, 100%)","borderTopLeftRadius":"4px","paddingTop":"16px","paddingLeft":"16px"}}},"variants":{"variant":{"red":{"alert":{"normal":{"border":"1px solid","borderColor":"rgba(188, 31, 31, 1)"}}},"yellow":{"alert":{"normal":{"border":"1px solid","borderColor":"hsl(50, 100%, 50%)"}}},"blue":{"alert":{"normal":{"border":"1px solid","borderColor":"hsl(210, 100%, 50%)"}}},"green":{"alert":{"normal":{"border":"1px solid","borderColor":"rgba(0, 235, 136, 1)"}}}}}}}/>
  );
});


