File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -8,31 +8,20 @@ import { capsule } from "@/util/utils";
8
8
import Link from "next/link" ;
9
9
10
10
const PreviewCard = ( { paper } : { paper : Paper } ) => {
11
-
12
- function handleOpen ( event : React . MouseEvent ) {
13
- event . stopPropagation ( ) ;
14
- const link = document . createElement ( "a" ) ;
15
- link . href = paper . finalUrl ;
16
- link . target = "_blank" ;
17
- link . rel = "noopener noreferrer" ;
18
- document . body . appendChild ( link ) ;
19
- link . click ( ) ;
20
- document . body . removeChild ( link ) ;
21
- }
22
11
return (
23
12
< div
24
13
key = { paper . _id }
25
14
className = "w-56 space-y-1 rounded-xl border border-black border-opacity-50 p-4 dark:border-[#7480FF]/25"
26
15
>
27
- < button onClick = { handleOpen } className = "w-full ">
16
+ < Link href = { paper . finalUrl } target = "_blank" rel = "noopener noreferrer ">
28
17
< Image
29
18
src = { paper . thumbnailUrl }
30
19
alt = { paper . subject }
31
20
width = { 180 }
32
21
height = { 180 }
33
22
className = "mb-2 h-[150px] w-full object-cover"
34
23
/>
35
- </ button >
24
+ </ Link >
36
25
< div className = "text-sm font-medium" >
37
26
{ extractBracketContent ( paper . subject ) }
38
27
</ div >
You can’t perform that action at this time.
0 commit comments