Skip to content

Commit 10c4745

Browse files
authored
Ebonsignori/5507 copyable code blocks (#56182)
1 parent 79efd60 commit 10c4745

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/frame/components/ui/MarkdownContent/UnrenderedMarkdownContent.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ export const UnrenderedMarkdownContent = ({
5555
})
5656

5757
return (
58-
<div>
58+
<div style={{ position: 'relative' }}>
5959
<IconButton
6060
size="small"
6161
icon={isCopied ? CheckIcon : CopyIcon}
6262
className="btn-octicon"
63-
aria-label={t('search.ai.response.copy_code')}
63+
aria-label={
64+
isCopied ? t('search.ai.response.copied_code') : t('search.ai.response.copy_code')
65+
}
6466
onClick={async () => {
6567
await copyToClipboard()
6668
announce(t('search.ai.response.copied_code'))
@@ -73,8 +75,8 @@ export const UnrenderedMarkdownContent = ({
7375
}}
7476
sx={{
7577
position: 'absolute',
76-
right: '1.3rem',
77-
marginTop: '-.7rem',
78+
right: '-.7rem',
79+
top: '-.7rem',
7880
zIndex: 1,
7981
}}
8082
></IconButton>

0 commit comments

Comments
 (0)