mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 08:41:37 +00:00
24 lines
517 B
TypeScript
24 lines
517 B
TypeScript
import clsx from 'clsx';
|
|
import CopyCode from 'components/post/copy-code';
|
|
import { DetailedHTMLProps, HTMLAttributes, memo } from 'react';
|
|
|
|
type Props = {} & DetailedHTMLProps<
|
|
HTMLAttributes<HTMLPreElement>,
|
|
HTMLPreElement
|
|
>;
|
|
|
|
const Pre = ({ ...rest }: Props) => {
|
|
const { children, className, ...props } = rest;
|
|
|
|
return (
|
|
<>
|
|
<pre className={clsx(className, 'relative group shadow-card')} {...props}>
|
|
{children}
|
|
<CopyCode />
|
|
</pre>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default memo(Pre);
|