diff --git a/components/code/code.tsx b/components/code/code.tsx index 1eedbe3..4b200ef 100644 --- a/components/code/code.tsx +++ b/components/code/code.tsx @@ -1,18 +1,13 @@ -import React, { useMemo } from 'react' +import React from 'react' import withDefaults from '../utils/with-defaults' -import useWarning from '../utils/use-warning' interface Props { - bash?: boolean - darkBash?: boolean block?: boolean width?: string className?: string } const defaultProps = { - bash: false, - darkBash: false, block: false, className: '', } @@ -23,27 +18,15 @@ export type CodeProps = Props & typeof defaultProps & NativeAttrs const Code: React.FC> = ({ children, block, - bash, - darkBash, className, width, ...props }) => { - if (bash) { - useWarning('Props "bash" is deprecated. Use `Snippet` instead of it.', 'code') - } - if (darkBash) { - useWarning('Props "darkBash" is deprecated. Use `Snippet` instead of it.', 'code') - } - - const isBash = bash || darkBash - const isBlock = isBash || block - if (!isBlock) return {children} - const classes = useMemo(() => `${darkBash ? 'dark' : ''} ${className}`, [className, darkBash]) + if (!block) return {children} return ( <> -
+      
         {children}
       
)