mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-09 10:45:16 -05:00
* Update Translations * Fix Prettier Issue * Fix Error in invokebutton.tsx * More Translations * few Fixes * More Translations * More Translations and lint Fixes * Update constants.ts Revert "Update constants.ts" --------- Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { ListItem, Text, UnorderedList } from '@chakra-ui/react';
|
|
import { some } from 'lodash-es';
|
|
import { memo } from 'react';
|
|
import { ImageUsage } from '../store/types';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
type Props = {
|
|
imageUsage?: ImageUsage;
|
|
topMessage?: string;
|
|
bottomMessage?: string;
|
|
};
|
|
const ImageUsageMessage = (props: Props) => {
|
|
const { t } = useTranslation();
|
|
const {
|
|
imageUsage,
|
|
topMessage = t('gallery.currentlyInUse'),
|
|
bottomMessage = t('gallery.featuresWillReset'),
|
|
} = props;
|
|
|
|
if (!imageUsage) {
|
|
return null;
|
|
}
|
|
|
|
if (!some(imageUsage)) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<Text>{topMessage}</Text>
|
|
<UnorderedList sx={{ paddingInlineStart: 6 }}>
|
|
{imageUsage.isInitialImage && (
|
|
<ListItem>{t('common.img2img')}</ListItem>
|
|
)}
|
|
{imageUsage.isCanvasImage && (
|
|
<ListItem>{t('common.unifiedCanvas')}</ListItem>
|
|
)}
|
|
{imageUsage.isControlNetImage && (
|
|
<ListItem>{t('common.controlNet')}</ListItem>
|
|
)}
|
|
{imageUsage.isNodesImage && (
|
|
<ListItem>{t('common.nodeEditor')}</ListItem>
|
|
)}
|
|
</UnorderedList>
|
|
<Text>{bottomMessage}</Text>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default memo(ImageUsageMessage);
|