1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00
unleash.unleash/frontend/src/component/project/Project/ProjectSettings/Settings/EditProject/DeleteProjectForm.tsx
Gastón Fournier bd8b54b5bd
fix: yarn lint:fix (#4917)
## About the changes
Running yarn lint:fix solves errors in frontend
2023-10-04 11:28:05 +02:00

37 lines
1.3 KiB
TypeScript

import React from 'react';
import { DeleteProject } from '../DeleteProject';
import FormTemplate from 'component/common/FormTemplate/FormTemplate';
import { useRequiredPathParam } from 'hooks/useRequiredPathParam';
import useProjectApi from 'hooks/api/actions/useProjectApi/useProjectApi';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
interface IDeleteProjectForm {
featureCount: number;
}
export const DeleteProjectForm = ({ featureCount }: IDeleteProjectForm) => {
const id = useRequiredPathParam('projectId');
const { uiConfig } = useUiConfig();
const { loading } = useProjectApi();
const formatProjectDeleteApiCode = () => {
return `curl --location --request DELETE '${uiConfig.unleashUrl}/api/admin/projects/${id}' \\
--header 'Authorization: INSERT_API_KEY' '`;
};
return (
<FormTemplate
loading={loading}
title='Delete Project'
description=''
documentationLink='https://docs.getunleash.io/reference/projects'
documentationLinkLabel='Projects documentation'
formatApiCode={formatProjectDeleteApiCode}
compact
compactPadding
showDescription={false}
showLink={false}
>
<DeleteProject projectId={id} featureCount={featureCount} />
</FormTemplate>
);
};