debian-image-builder-frontend/src/Components/Blueprints/EditBlueprintButton.tsx
regexowl 7115b43c3d Blueprints: Surface "Edit blueprint" button
This surfaces "Edit blueprint" button to the ImageTableToolbar and removes it from the blueprints actions menu as per recent mocks.
2024-04-16 18:31:05 +03:00

25 lines
692 B
TypeScript

import React from 'react';
import { Button } from '@patternfly/react-core';
import { useNavigate } from 'react-router-dom';
import { selectSelectedBlueprintId } from '../../store/BlueprintSlice';
import { useAppSelector } from '../../store/hooks';
import { resolveRelPath } from '../../Utilities/path';
export const EditBlueprintButton = () => {
const navigate = useNavigate();
const selectedBlueprintId = useAppSelector(selectSelectedBlueprintId);
return (
<Button
ouiaId="edit-blueprint-button"
onClick={() =>
navigate(resolveRelPath(`imagewizard/${selectedBlueprintId}`))
}
variant="secondary"
>
Edit blueprint
</Button>
);
};