1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-24 17:51:14 +02:00
unleash.unleash/frontend/src/component/featureTypes/FeatureTypeEdit/FeatureTypeEdit.tsx
Tymoteusz Czech 464297d4be
feat: Feature type lifetime API integration (#4295)
## About the changes
API integration and tests.
2023-07-21 09:51:09 +00:00

22 lines
614 B
TypeScript

import { VFC } from 'react';
import { useParams } from 'react-router-dom';
import { FeatureTypeSchema } from 'openapi';
import { FeatureTypeForm } from './FeatureTypeForm/FeatureTypeForm';
type FeatureTypeEditProps = {
featureTypes: FeatureTypeSchema[];
loading: boolean;
};
export const FeatureTypeEdit: VFC<FeatureTypeEditProps> = ({
featureTypes,
loading,
}) => {
const { featureTypeId } = useParams();
const featureType = featureTypes.find(
featureType => featureType.id === featureTypeId
);
return <FeatureTypeForm featureType={featureType} loading={loading} />;
};