File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
import Image from "next/image" ;
2
- import { useState } from "react" ;
2
+ import { useEffect , useState } from "react" ;
3
3
import { ClipboardCheckIcon , ClipboardIcon } from "lucide-react" ;
4
4
5
5
import PairItem from "./PairItem" ;
@@ -14,10 +14,14 @@ interface PairCardProps {
14
14
export default function PairCard ( { pair } : PairCardProps ) {
15
15
const [ copied , setCopied ] = useState ( false ) ;
16
16
17
+ useEffect ( ( ) => {
18
+ setTimeout ( ( ) => setCopied ( false ) , 1000 ) ;
19
+ } ) ;
20
+
17
21
const copyToClipboard = ( font : string , theme : string ) => {
18
22
navigator . clipboard . writeText ( `{
19
- "editor.fontFamily": ${ font } ,
20
- "workbench.colorTheme": ${ theme }
23
+ "editor.fontFamily": " ${ font } " ,
24
+ "workbench.colorTheme": " ${ theme } "
21
25
}` ) ;
22
26
setCopied ( ( prev ) => ! prev ) ;
23
27
} ;
You can’t perform that action at this time.
0 commit comments