refactor: create cluster ux
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
const useCreateCluster = (options: { refresh: () => void }) => {
|
||||
const [clusterModalStatus, setClusterModalStatus] = useState<{
|
||||
open: boolean;
|
||||
}>({
|
||||
open: false
|
||||
});
|
||||
|
||||
const openClusterModal = () => {
|
||||
setClusterModalStatus({ open: true });
|
||||
};
|
||||
|
||||
const closeClusterModal = () => {
|
||||
setClusterModalStatus({ open: false });
|
||||
options.refresh();
|
||||
};
|
||||
|
||||
return {
|
||||
clusterModalStatus,
|
||||
openClusterModal,
|
||||
closeClusterModal
|
||||
};
|
||||
};
|
||||
|
||||
export default useCreateCluster;
|
||||
Reference in New Issue
Block a user