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" ;
33import {
4- ContextMenu ,
5- ContextMenuContent ,
6- ContextMenuItem ,
7- ContextMenuLabel ,
8- ContextMenuTrigger ,
4+ ContextMenu ,
5+ ContextMenuContent ,
6+ ContextMenuItem ,
7+ ContextMenuLabel ,
8+ ContextMenuTrigger ,
99} 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" ;
1313import Image from "next/image" ;
14- import { SetStateAction } from "react" ;
14+ import { SetStateAction } from "react" ;
1515import toast from "react-hot-toast" ;
1616
1717interface PasswordEntry {
@@ -68,7 +68,8 @@ const PasswordItem = ({
6868 < div
6969 className = { cn (
7070 "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"
7273 ) }
7374 onClick = { ( ) => setSelectedEntry ( password ) }
7475 >
@@ -92,21 +93,23 @@ const PasswordItem = ({
9293 </ div >
9394 </ div >
9495
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+ ) }
110113 </ div >
111114 </ ContextMenuTrigger >
112115 < ContextMenuContent className = "rounded-xl" >
0 commit comments