Skip to content

Commit

Permalink
Fix handleOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-slobodian committed Jun 24, 2024
1 parent 58213a1 commit d189624
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 10 additions & 2 deletions src/components/certificates-list/CertificatesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ import styles from "./styles/index.module.scss";

interface CertificatesListProps {
certificates: CertificateProps[];
onDelete: (certificateId: string, providerId: string, label: string) => void;
onDelete: (params: {
certificateIndex: string;
providerId: string;
label: string;
}) => void;
onViewDetails: (certificate: CertificateProps) => void;
}

Expand Down Expand Up @@ -139,7 +143,11 @@ export const CertificatesList: React.FunctionComponent<
tabIndex={0}
title={t("certificates.list.action.delete")}
onClick={() =>
onDelete(index, providerID, label as string)
onDelete({
certificateIndex: index,
providerId: providerID,
label: label as string,
})
}
size="small"
className={styles.action_icon_button}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,8 @@ export function useCertificateDeleteDialog(
const [isOpen, setIsOpen] = React.useState(false);
const openParamsRef = React.useRef<UseCertificateDeleteDialogOpenParams>();

const handleOpen = (
certificateIndex: string,
providerId: string,
label: string
) => {
openParamsRef.current = {
certificateIndex,
providerId,
label,
};
const handleOpen = (params: UseCertificateDeleteDialogOpenParams) => {
openParamsRef.current = params;
setIsOpen(true);
};

Expand Down

0 comments on commit d189624

Please sign in to comment.