@@ -3,11 +3,11 @@ import {useGlobalContext} from "@/context/global-context.tsx"
33import { useApplyCookie } from "@/hooks/useCookie.ts"
44import { CookieData } from "@/types/types"
55import { Button } from "@/components/ui/button"
6- import { Check , Copy , FilePen , GripVertical , MoreHorizontal , Trash } from "lucide-react"
7- import { DropdownMenu , DropdownMenuContent , DropdownMenuItem , DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
6+ import { GripVertical } from "lucide-react"
87import { ProjectAvatar } from "@/components/ui/project-avatar"
98import { TableCell , TableHead , TableRow } from "@/components/ui/table"
109import toast from "react-hot-toast"
10+ import ActionButtons from "@/app/components/shared/ActionButtons"
1111
1212interface CookieTableProps {
1313 cookies : CookieData [ ] ;
@@ -74,50 +74,13 @@ export default function CookieTable({
7474 </ div >
7575 </ TableCell >
7676 < TableCell style = { { width : COLUMN_WIDTHS . actions , paddingLeft : '16px' } } >
77- < div className = "flex items-center gap-1" onClick = { ( e ) => e . stopPropagation ( ) } >
78- < DropdownMenu >
79- < DropdownMenuTrigger asChild >
80- < Button variant = "ghost" size = "icon" className = "h-7 w-7" >
81- < MoreHorizontal className = "h-3.5 w-3.5" />
82- </ Button >
83- </ DropdownMenuTrigger >
84- < DropdownMenuContent align = "end" >
85- < DropdownMenuItem onClick = { ( ) => handleEdit ( cookie ) } className = "cursor-pointer" >
86- < FilePen className = "h-3.5 w-3.5 mr-2" />
87- Edit
88- </ DropdownMenuItem >
89- < DropdownMenuItem
90- className = "text-destructive focus:text-destructive cursor-pointer"
91- onClick = { ( ) => handleDeleteProfile ( cookie ) }
92- >
93- < Trash className = "h-3.5 w-3.5 mr-2" />
94- Delete
95- </ DropdownMenuItem >
96- </ DropdownMenuContent >
97- </ DropdownMenu >
98- < Button
99- variant = "ghost"
100- size = "icon"
101- className = "h-7 w-7"
102- onClick = { ( e ) => {
103- handleCopy ( cookie . value ) ;
104- } }
105- title = "Copy value"
106- >
107- < Copy className = "h-3.5 w-3.5" />
108- </ Button >
109- < Button
110- className = { `h-7 w-7` }
111- onClick = { async ( e ) => {
112- await useApplyCookie ( cookie )
113- } }
114- variant = "secondary"
115- size = "icon"
116- title = "Apply"
117- >
118- < Check className = "h-3.5 w-3.5" />
119- </ Button >
120- </ div >
77+ < ActionButtons
78+ onEdit = { ( ) => handleEdit ( cookie ) }
79+ onDelete = { ( ) => handleDeleteProfile ( cookie ) }
80+ onCopy = { ( ) => handleCopy ( cookie . value ) }
81+ onApply = { async ( ) => await useApplyCookie ( cookie ) }
82+ copyTitle = "Copy value"
83+ />
12184 </ TableCell >
12285 </ >
12386 )
0 commit comments