debian-image-builder-frontend/src/Components/CreateImageWizard/steps/FileSystem/index.tsx
regexowl 46b6fda9db src: Resolve last remaining circular dependency
Nothing added, nothing removed, stuff moved around a bit.
2024-10-11 14:55:03 +02:00

45 lines
1.5 KiB
TypeScript

import React from 'react';
import { Text, Form, Title } from '@patternfly/react-core';
import FileSystemAutomaticPartition from './FileSystemAutomaticPartitionInformation';
import FileSystemConfiguration from './FileSystemConfiguration';
import FileSystemPartition from './FileSystemPartition';
import { useAppSelector } from '../../../../store/hooks';
import { selectFileSystemConfigurationType } from '../../../../store/wizardSlice';
import { useHasSpecificTargetOnly } from '../../utilities/hasSpecificTargetOnly';
export type FileSystemConfigurationType = 'automatic' | 'manual';
const FileSystemStep = () => {
const fileSystemConfigurationType = useAppSelector(
selectFileSystemConfigurationType
);
const hasIsoTargetOnly = useHasSpecificTargetOnly('image-installer');
return (
<Form>
<Title headingLevel="h1" size="xl">
File system configuration
</Title>
<Text>Define the partitioning of the image</Text>
{hasIsoTargetOnly ? (
<FileSystemAutomaticPartition />
) : fileSystemConfigurationType === 'automatic' ? (
<>
<FileSystemPartition />
<FileSystemAutomaticPartition />
</>
) : fileSystemConfigurationType === 'manual' ? (
<>
<FileSystemPartition />
<FileSystemConfiguration />
</>
) : (
fileSystemConfigurationType === 'oscap' && <FileSystemConfiguration />
)}
</Form>
);
};
export default FileSystemStep;