This commit is contained in:
Anang Yusman 2025-09-29 17:03:37 +08:00
parent 6f30111176
commit 79a5967dec
1 changed files with 13 additions and 19 deletions

View File

@ -243,18 +243,15 @@ export default function ArticleTable() {
</Link> </Link>
</DropdownMenuItem> </DropdownMenuItem>
{(username === "admin-mabes" || <DropdownMenuItem asChild>
Number(userId) === article.createdById) && ( <Link
<DropdownMenuItem asChild> href={`/admin/article/edit/${article.id}`}
<Link className="flex items-center"
href={`/admin/article/edit/${article.id}`} >
className="flex items-center" <CreateIconIon className="mr-2 h-4 w-4" />
> Edit
<CreateIconIon className="mr-2 h-4 w-4" /> </Link>
Edit </DropdownMenuItem>
</Link>
</DropdownMenuItem>
)}
{username === "admin-mabes" && ( {username === "admin-mabes" && (
<DropdownMenuItem <DropdownMenuItem
@ -269,13 +266,10 @@ export default function ArticleTable() {
</DropdownMenuItem> </DropdownMenuItem>
)} )}
{(username === "admin-mabes" || <DropdownMenuItem onClick={() => handleDelete(article.id)}>
Number(userId) === article.createdById) && ( <DeleteIcon className="mr-2 h-4 w-4 text-red-500" />
<DropdownMenuItem onClick={() => handleDelete(article.id)}> Delete
<DeleteIcon className="mr-2 h-4 w-4 text-red-500" /> </DropdownMenuItem>
Delete
</DropdownMenuItem>
)}
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
</div> </div>