feat: show language name (#113)

This commit is contained in:
Redon 2023-03-24 16:43:44 +08:00 committed by GitHub
parent ad2e1f0d4c
commit bc3b6d3355
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 13 deletions

View File

@ -49,19 +49,22 @@ export const CodeBlock: FC<Props> = ({ language, value, lightMode }) => {
}; };
return ( return (
<div className="relative text-[16px]"> <div className="relative text-[16px]">
<div className="flex items-center justify-end"> <div className="flex items-center justify-between">
<button <span className="text-xs text-white">{language}</span>
className="text-white bg-none py-0.5 px-2 rounded focus:outline-none hover:bg-blue-700 text-xs" <div className="flex items-center">
onClick={copyToClipboard} <button
> className="text-white bg-none py-0.5 px-2 rounded focus:outline-none hover:bg-blue-700 text-xs"
{buttonText} onClick={copyToClipboard}
</button> >
<button {buttonText}
className="text-white bg-none py-0.5 px-2 rounded focus:outline-none hover:bg-blue-700 text-xs" </button>
onClick={downloadAsFile} <button
> className="text-white bg-none py-0.5 px-2 rounded focus:outline-none hover:bg-blue-700 text-xs"
<IconDownload size={16} /> onClick={downloadAsFile}
</button> >
<IconDownload size={16} />
</button>
</div>
</div> </div>
<SyntaxHighlighter <SyntaxHighlighter