Files
gpustack-ui/src/pages/cluster-management/cluster-modal.tsx
T

51 lines
1.0 KiB
TypeScript

import { PageAction } from '@/config';
import { GSDrawer } from '@gpustack/core-ui';
import React from 'react';
import ClusterCreate from './cluster-create';
interface ClusterModalProps {
open: boolean;
title: string;
onClose: () => void;
}
const ClusterModal: React.FC<ClusterModalProps> = ({
open,
onClose,
title
}) => {
const [currentTitle, setCurrentTitle] = React.useState<string>(title);
const handleCancel = () => {
onClose();
};
return (
<GSDrawer
title={currentTitle}
open={open}
onClose={handleCancel}
destroyOnHidden={true}
closeIcon={false}
mask={{
closable: false
}}
keyboard={false}
styles={{
body: {
paddingBlock: 0
},
wrapper: { width: 710 }
}}
footer={false}
>
<ClusterCreate
onClose={handleCancel}
action={PageAction.CREATE}
setCurrentTitle={setCurrentTitle}
></ClusterCreate>
</GSDrawer>
);
};
export default ClusterModal;