File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
src/components/expandable Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ export function Expandable({
3838
3939 const [ isExpanded , setIsExpanded ] = useState ( false ) ;
4040 const [ copied , setCopied ] = useState ( false ) ;
41- const [ showCopyButton , setShowCopyButton ] = useState ( false ) ;
4241 const contentRef = useRef < HTMLDivElement > ( null ) ;
4342
4443 // Ensure we scroll to the element if the URL hash matches
@@ -67,12 +66,6 @@ export function Expandable({
6766 } ;
6867 } , [ id ] ) ;
6968
70- useEffect ( ( ) => {
71- if ( copy ) {
72- setShowCopyButton ( true ) ;
73- }
74- } , [ copy ] ) ;
75-
7669 async function copyContentOnClick ( event : React . MouseEvent < HTMLButtonElement > ) {
7770 event . stopPropagation ( ) ; // Prevent the details element from toggling
7871 event . preventDefault ( ) ; // Prevent default summary click behavior
@@ -153,8 +146,8 @@ export function Expandable({
153146 onClick = { copyContentOnClick }
154147 type = "button" // Important for buttons in summaries
155148 >
156- { showCopyButton && ! copied && 'Copy Rules' }
157- { showCopyButton && copied && 'Copied!' }
149+ { ! copied && 'Copy Rules' }
150+ { copied && 'Copied!' }
158151 </ button >
159152 ) }
160153 </ summary >
You can’t perform that action at this time.
0 commit comments