mirror of
https://github.com/RYDE-WORK/full-stack-fastapi-template.git
synced 2026-01-19 13:13:25 +08:00
28 lines
738 B
TypeScript
28 lines
738 B
TypeScript
import { IconButton } from "@chakra-ui/react"
|
|
import { BsThreeDotsVertical } from "react-icons/bs"
|
|
import { MenuContent, MenuRoot, MenuTrigger } from "../ui/menu"
|
|
|
|
import type { ItemPublic } from "../../client"
|
|
import DeleteItem from "../Items/DeleteItem"
|
|
import EditItem from "../Items/EditItem"
|
|
|
|
interface ItemActionsMenuProps {
|
|
item: ItemPublic
|
|
}
|
|
|
|
export const ItemActionsMenu = ({ item }: ItemActionsMenuProps) => {
|
|
return (
|
|
<MenuRoot>
|
|
<MenuTrigger asChild>
|
|
<IconButton variant="ghost" color="inherit">
|
|
<BsThreeDotsVertical />
|
|
</IconButton>
|
|
</MenuTrigger>
|
|
<MenuContent>
|
|
<EditItem item={item} />
|
|
<DeleteItem id={item.id} />
|
|
</MenuContent>
|
|
</MenuRoot>
|
|
)
|
|
}
|