Skip to content

Commit

Permalink
feat(ui): format warnings tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Nov 29, 2024
1 parent df0c7d7 commit 46a09d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion invokeai/frontend/web/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@
"reset": "Reset",
"none": "None",
"new": "New",
"generating": "Generating"
"generating": "Generating",
"warnings": "Warnings"
},
"hrf": {
"hrf": "High Resolution Fix",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IconButton, ListItem, UnorderedList } from '@invoke-ai/ui-library';
import { Flex, IconButton, ListItem, Text, UnorderedList } from '@invoke-ai/ui-library';
import { createSelector } from '@reduxjs/toolkit';
import { EMPTY_ARRAY } from 'app/store/constants';
import { useAppSelector } from 'app/store/storeHooks';
Expand Down Expand Up @@ -86,12 +86,16 @@ export const CanvasEntityHeaderWarnings = memo(() => {
CanvasEntityHeaderWarnings.displayName = 'CanvasEntityHeaderWarnings';

const TooltipContent = memo((props: { warnings: string[] }) => {
const { t } = useTranslation();
return (
<UnorderedList>
{props.warnings.map((warning, index) => (
<ListItem key={index}>{warning}</ListItem>
))}
</UnorderedList>
<Flex flexDir="column">
<Text>{t('common.warnings')}:</Text>
<UnorderedList>
{props.warnings.map((warning, index) => (
<ListItem key={index}>{warning}</ListItem>
))}
</UnorderedList>
</Flex>
);
});
TooltipContent.displayName = 'TooltipContent';

0 comments on commit 46a09d9

Please sign in to comment.