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,7 +49,9 @@ 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">
<span className="text-xs text-white">{language}</span>
<div className="flex items-center">
<button <button
className="text-white bg-none py-0.5 px-2 rounded focus:outline-none hover:bg-blue-700 text-xs" className="text-white bg-none py-0.5 px-2 rounded focus:outline-none hover:bg-blue-700 text-xs"
onClick={copyToClipboard} onClick={copyToClipboard}
@ -63,6 +65,7 @@ export const CodeBlock: FC<Props> = ({ language, value, lightMode }) => {
<IconDownload size={16} /> <IconDownload size={16} />
</button> </button>
</div> </div>
</div>
<SyntaxHighlighter <SyntaxHighlighter
language={language} language={language}