Compare commits
2 Commits
494521d51d
...
b5745a3c05
Author | SHA1 | Date |
---|---|---|
|
b5745a3c05 | |
|
878daf35bb |
|
@ -1,6 +1,6 @@
|
||||||
import { Dialog, DialogTrigger, DialogClose, DialogDescription, DialogContent, DialogTitle, DialogHeader, DialogFooter } from "@/components/ui/dialog"
|
import { Dialog, DialogTrigger, DialogClose, DialogDescription, DialogContent, DialogTitle, DialogHeader, DialogFooter } from "@/components/ui/dialog"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { Trash2, Search } from "lucide-react"
|
import { Trash2, Search, Pencil } from "lucide-react"
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
|
|
||||||
export function actions({ pathname, deleteFn }: { pathname: string, deleteFn: (id: number) => void }) {
|
export function actions({ pathname, deleteFn }: { pathname: string, deleteFn: (id: number) => void }) {
|
||||||
|
@ -9,7 +9,13 @@ export function actions({ pathname, deleteFn }: { pathname: string, deleteFn: (i
|
||||||
// header: "Actions",
|
// header: "Actions",
|
||||||
cell: ({ row }) => {
|
cell: ({ row }) => {
|
||||||
return <div className="flex items-center justify-around">
|
return <div className="flex items-center justify-around">
|
||||||
<Link href={`${pathname}/${row.original.id}`}><Button variant="ghost"><Search /></Button></Link>
|
{!(pathname === "/submission") ?
|
||||||
|
<Link href={`${pathname}/${row.original.id}`}><Button variant="ghost"><Search /></Button></Link>
|
||||||
|
: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
<Link href={`${pathname}/edit/${row.original.id}`}><Button variant="ghost"><Pencil /></Button></Link>
|
||||||
|
|
||||||
<Dialog>
|
<Dialog>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<Button variant="ghost"><Trash2 color="red" /></Button>
|
<Button variant="ghost"><Trash2 color="red" /></Button>
|
||||||
|
|
Loading…
Reference in New Issue