Skip to content

Commit

Permalink
change edit & delete buttons
Browse files Browse the repository at this point in the history
Signed-off-by: HadasahR <d025834828@gmail.com>
  • Loading branch information
HadasahR committed Sep 22, 2024
1 parent 545bfcf commit 91a5ae4
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions client/src/app/pages/controls/tags/components/tag-table.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import React from "react";
import { useTranslation } from "react-i18next";
import {
Table,
Thead,
Tr,
Th,
Tbody,
Td,
ActionsColumn,
} from "@patternfly/react-table";
import { Tag, TagCategory } from "@app/api/models";
import { Table, Thead, Tr, Th, Tbody, Td } from "@patternfly/react-table";
import { StakeholderGroup, Tag, TagCategory } from "@app/api/models";
import "./tag-table.css";
import { universalComparator } from "@app/utils/utils";
import { AppTableActionButtons } from "@app/components/AppTableActionButtons";

export interface TabTableProps {
tagCategory: TagCategory;
Expand All @@ -25,7 +18,14 @@ export const TagTable: React.FC<TabTableProps> = ({
onDelete,
}) => {
const { t } = useTranslation();

const [stakeholderGroupToDelete, setStakeholderGroupToDelete] =
React.useState<StakeholderGroup>();
const [createUpdateModalState, setCreateUpdateModalState] = React.useState<
"create" | StakeholderGroup | null
>(null);
const deleteRow = (row: StakeholderGroup) => {
setStakeholderGroupToDelete(row);
};
return (
<Table borders={false} aria-label="Tag table" variant="compact" isNested>
<Thead noWrap>
Expand All @@ -41,17 +41,9 @@ export const TagTable: React.FC<TabTableProps> = ({
<Tr key={tag.name}>
<Td>{tag.name}</Td>
<Td isActionCell>
<ActionsColumn
items={[
{
title: t("actions.edit"),
onClick: () => onEdit(tag),
},
{
title: t("actions.delete"),
onClick: () => onDelete(tag),
},
]}
<AppTableActionButtons
onEdit={() => onEdit(tag)}
onDelete={() => onDelete(tag)}
/>
</Td>
</Tr>
Expand Down

0 comments on commit 91a5ae4

Please sign in to comment.