mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-30 14:22:05 +00:00
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { MessageBar, MessageBarType, Stack } from "@fluentui/react";
|
|
import React from "react";
|
|
import { useCopyJobContext } from "../../Context/CopyJobContext";
|
|
import { useCopyJobNavigation } from "../Utils/useCopyJobNavigation";
|
|
import NavigationControls from "./Components/NavigationControls";
|
|
|
|
const CreateCopyJobScreens: React.FC = () => {
|
|
const {
|
|
currentScreen,
|
|
isPrimaryDisabled,
|
|
isPreviousDisabled,
|
|
handlePrimary,
|
|
handlePrevious,
|
|
handleCancel,
|
|
primaryBtnText,
|
|
showAddCollectionPanel,
|
|
} = useCopyJobNavigation();
|
|
const { contextError, setContextError } = useCopyJobContext();
|
|
|
|
return (
|
|
<Stack verticalAlign="space-between" className="createCopyJobScreensContainer">
|
|
<Stack.Item className="createCopyJobScreensContent">
|
|
{contextError && (
|
|
<MessageBar
|
|
className="createCopyJobErrorMessageBar"
|
|
messageBarType={MessageBarType.blocked}
|
|
isMultiline={false}
|
|
onDismiss={() => setContextError(null)}
|
|
dismissButtonAriaLabel="Close"
|
|
truncated={true}
|
|
overflowButtonAriaLabel="See more"
|
|
>
|
|
{contextError}
|
|
</MessageBar>
|
|
)}
|
|
{React.cloneElement(currentScreen?.component as React.ReactElement, { showAddCollectionPanel })}
|
|
</Stack.Item>
|
|
<Stack.Item className="createCopyJobScreensFooter">
|
|
<NavigationControls
|
|
primaryBtnText={primaryBtnText}
|
|
onPrimary={handlePrimary}
|
|
onPrevious={handlePrevious}
|
|
onCancel={handleCancel}
|
|
isPrimaryDisabled={isPrimaryDisabled}
|
|
isPreviousDisabled={isPreviousDisabled}
|
|
/>
|
|
</Stack.Item>
|
|
</Stack>
|
|
);
|
|
};
|
|
|
|
export default CreateCopyJobScreens;
|