1
- import { deletePasswordItem , getPasswords } from "@/app/actions" ;
2
- import { Button } from "@/components/ui/button" ;
1
+ import { deletePasswordItem , getPasswords } from "@/app/actions" ;
2
+ import { Button } from "@/components/ui/button" ;
3
3
import {
4
- ContextMenu ,
5
- ContextMenuContent ,
6
- ContextMenuItem ,
7
- ContextMenuLabel ,
8
- ContextMenuTrigger ,
4
+ ContextMenu ,
5
+ ContextMenuContent ,
6
+ ContextMenuItem ,
7
+ ContextMenuLabel ,
8
+ ContextMenuTrigger ,
9
9
} from "@/components/ui/context-menu" ;
10
- import { cn } from "@/lib/utils" ;
11
- import { $Enums } from "@prisma/client" ;
12
- import { SquareArrowOutUpRight , Trash , User , X } from "lucide-react" ;
10
+ import { cn } from "@/lib/utils" ;
11
+ import { $Enums } from "@prisma/client" ;
12
+ import { SquareArrowOutUpRight , Trash , User , X } from "lucide-react" ;
13
13
import Image from "next/image" ;
14
- import { SetStateAction } from "react" ;
14
+ import { SetStateAction } from "react" ;
15
15
import toast from "react-hot-toast" ;
16
16
17
17
interface PasswordEntry {
@@ -68,7 +68,8 @@ const PasswordItem = ({
68
68
< div
69
69
className = { cn (
70
70
"flex w-full justify-between rounded-xl p-2 text-left transition-all hover:bg-rose-50/50 dark:hover:bg-rose-900/50 hover:cursor-pointer" ,
71
- selectedEntry ?. id === password . id && "bg-rose-50 dark:bg-rose-900"
71
+ selectedEntry ?. id === password . id &&
72
+ "bg-rose-50 dark:bg-rose-900 hover:bg-rose-50/60"
72
73
) }
73
74
onClick = { ( ) => setSelectedEntry ( password ) }
74
75
>
@@ -92,21 +93,23 @@ const PasswordItem = ({
92
93
</ div >
93
94
</ div >
94
95
95
- < Button
96
- variant = "ghost"
97
- size = "icon"
98
- className = { cn (
99
- "text-muted-foreground hover:text-foreground hover:bg-rose-50" ,
100
- selectedEntry ?. id === password . id && "bg-rose-100"
101
- ) }
102
- onClick = { ( e ) => {
103
- e . stopPropagation ( ) ;
104
- setPasswordToDelete ( password ) ;
105
- setIsConfirmationDialogOpen ( true ) ;
106
- } }
107
- >
108
- < X className = "h-4 w-4" />
109
- </ Button >
96
+ { selectedEntry ?. id === password . id && (
97
+ < Button
98
+ variant = "ghost"
99
+ size = "icon"
100
+ className = { cn (
101
+ "text-muted-foreground hover:text-foreground hover:bg-muted rounded-full" ,
102
+ selectedEntry ?. id === password . id && "bg-muted/20"
103
+ ) }
104
+ onClick = { ( e ) => {
105
+ e . stopPropagation ( ) ;
106
+ setPasswordToDelete ( password ) ;
107
+ setIsConfirmationDialogOpen ( true ) ;
108
+ } }
109
+ >
110
+ < X className = "h-4 w-4" />
111
+ </ Button >
112
+ ) }
110
113
</ div >
111
114
</ ContextMenuTrigger >
112
115
< ContextMenuContent className = "rounded-xl" >
0 commit comments