mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): add tooltip to IAIMantineSelect
This commit is contained in:
parent
4a991b4daa
commit
4ba5086b9a
@ -1,16 +1,20 @@
|
|||||||
import { forwardRef } from '@chakra-ui/react';
|
import { Tooltip, forwardRef } from '@chakra-ui/react';
|
||||||
import { Select, SelectProps } from '@mantine/core';
|
import { Select, SelectProps } from '@mantine/core';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
|
|
||||||
type IAISelectProps = SelectProps;
|
type IAISelectProps = SelectProps & {
|
||||||
|
tooltip?: string;
|
||||||
|
};
|
||||||
|
|
||||||
const IAIMantineSelect = forwardRef((props: IAISelectProps, ref) => {
|
const IAIMantineSelect = forwardRef((props: IAISelectProps, ref) => {
|
||||||
const { searchable = true, ...rest } = props;
|
const { searchable = true, tooltip, ...rest } = props;
|
||||||
return (
|
return (
|
||||||
|
<Tooltip label={tooltip} placement="top" hasArrow>
|
||||||
<Select
|
<Select
|
||||||
ref={ref}
|
ref={ref}
|
||||||
searchable={searchable}
|
searchable={searchable}
|
||||||
styles={() => ({
|
styles={() => ({
|
||||||
|
root: {},
|
||||||
label: {
|
label: {
|
||||||
color: 'var(--invokeai-colors-base-300)',
|
color: 'var(--invokeai-colors-base-300)',
|
||||||
fontWeight: 'normal',
|
fontWeight: 'normal',
|
||||||
@ -57,6 +61,7 @@ const IAIMantineSelect = forwardRef((props: IAISelectProps, ref) => {
|
|||||||
})}
|
})}
|
||||||
{...rest}
|
{...rest}
|
||||||
/>
|
/>
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ const ParamControlNetModel = (props: ParamControlNetModelProps) => {
|
|||||||
value={model}
|
value={model}
|
||||||
onChange={handleModelChanged}
|
onChange={handleModelChanged}
|
||||||
disabled={!isReady}
|
disabled={!isReady}
|
||||||
|
tooltip={model}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
// return (
|
// return (
|
||||||
|
@ -63,6 +63,7 @@ const ModelSelect = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IAIMantineSelect
|
<IAIMantineSelect
|
||||||
|
tooltip={selectedModel?.description}
|
||||||
label={t('modelManager.model')}
|
label={t('modelManager.model')}
|
||||||
value={selectedModel?.name ?? ''}
|
value={selectedModel?.name ?? ''}
|
||||||
placeholder="Pick one"
|
placeholder="Pick one"
|
||||||
|
Loading…
Reference in New Issue
Block a user