INTO-CPS-Association/DTaaS

View on GitHub
client/src/preview/components/asset/ReconfigureButton.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import * as React from 'react';
import { Button } from '@mui/material';
import { Dispatch, SetStateAction } from 'react';

interface ReconfigureButtonProps {
  setShowReconfigure: Dispatch<SetStateAction<boolean>>;
}

export const handleToggleReconfigureDialog = (
  setShowReconfigure: Dispatch<SetStateAction<boolean>>,
) => {
  setShowReconfigure((prev) => !prev);
};

function ReconfigureButton({ setShowReconfigure }: ReconfigureButtonProps) {
  return (
    <Button
      variant="contained"
      size="small"
      color="primary"
      onClick={() => handleToggleReconfigureDialog(setShowReconfigure)}
    >
      Reconfigure
    </Button>
  );
}

export default ReconfigureButton;