debian-image-builder-frontend/src/Components/CreateImageWizard/steps/Packages/components/CustomHelperText.tsx
regexowl 25a5f140d8 ESLint: Add rule to sort imports alphabetically
The `import/order` rule isn't enough to sort import within a single import group alphabetically.

This adds `sort-imports` rule that handles the sorting within groups.
2025-07-15 16:52:45 +00:00

41 lines
860 B
TypeScript

import React from 'react';
import {
FormHelperText,
HelperText,
HelperTextItem,
} from '@patternfly/react-core';
import { ExclamationCircleIcon } from '@patternfly/react-icons';
export type HelperTextVariant =
| 'default'
| 'indeterminate'
| 'warning'
| 'success'
| 'error';
interface Props {
variant?: HelperTextVariant;
textValue?: string;
defaultText?: string;
hide?: boolean;
}
const CustomHelperText = ({
hide = false,
variant = 'error',
textValue = '',
defaultText = '',
}: Props) =>
(!!textValue || !!defaultText) && !hide ? (
<FormHelperText>
<HelperText>
<HelperTextItem icon={<ExclamationCircleIcon />} variant={variant}>
{textValue ? textValue : defaultText}
</HelperTextItem>
</HelperText>
</FormHelperText>
) : (
<></>
);
export default CustomHelperText;