import React from 'react';
import { Code as CodePrimitive, CodeProps as CodePropsPrimitive } from '@modulz/primitives';

export type CodeProps = CodePropsPrimitive

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

export const Code = React.forwardRef<PrimitiveRefType, CodeProps>((props, ref) => {
  return (
    <CodePrimitive {...props} ref={ref}  styleConfig={{"base":{"code":{"normal":{"color":"rgba(255, 255, 255, 1)","paddingTop":"2px","fontFamily":"Fira Mono,monospace","borderBottomLeftRadius":"2px","fontSize":"0.8em","borderTopRightRadius":"2px","paddingBottom":"2px","borderBottomRightRadius":"2px","backgroundColor":"rgba(255, 255, 255, 0.1)","letterSpacing":"-0.5px","borderTopLeftRadius":"2px","paddingRight":"5px","paddingLeft":"5px"}}},"variants":{}}}/>
  );
});


