Skip to content

Commit

Permalink
feat Showed delete and switch project buttons only when available (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chavda-bhavik authored Oct 23, 2024
2 parents 9988095 + ea47dbb commit 41d378c
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions apps/web/components/ManageProject/ManageProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,16 @@ export function ManageProjectModal() {
title: 'Actions',
Cell: (item) => (
<Flex justify="flex-end" gap="xs">
<IconButton
label="Switch Project"
disabled={item._id === currentProjectId}
onClick={() => {
onProjectIdChange(item._id as string);
}}
>
<SwapIcon size="md" />
</IconButton>
<IconButton
label="Delete Project"
disabled={!item.isOwner}
onClick={() => {
handleDeleteProject(item._id as string);
}}
>
<DeleteIcon size="md" />
</IconButton>
{item._id === currentProjectId ? (
<IconButton label="Switch Project" onClick={() => onProjectIdChange(item._id as string)}>
<SwapIcon size="md" />
</IconButton>
) : null}
{item.isOwner ? (
<IconButton label="Delete Project" onClick={() => handleDeleteProject(item._id as string)}>
<DeleteIcon size="md" />
</IconButton>
) : null}
</Flex>
),
},
Expand Down

0 comments on commit 41d378c

Please sign in to comment.