InvokeAI/invokeai/frontend/web/src/features/embedding/AddEmbeddingButton.tsx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
698 B
TypeScript
Raw Normal View History

2024-01-20 00:04:19 +00:00
import { IconButton, Tooltip } from '@invoke-ai/ui';
2023-12-29 03:05:56 +00:00
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
2024-01-19 03:40:31 +00:00
import { PiCodeBold } from 'react-icons/pi';
type Props = {
isOpen: boolean;
onOpen: () => void;
};
2023-12-29 03:05:56 +00:00
export const AddEmbeddingButton = memo((props: Props) => {
const { onOpen, isOpen } = props;
const { t } = useTranslation();
return (
2024-01-20 00:04:19 +00:00
<Tooltip label={t('embedding.addEmbedding')}>
<IconButton
variant="promptOverlay"
isDisabled={isOpen}
aria-label={t('embedding.addEmbedding')}
2024-01-18 04:08:38 +00:00
icon={<PiCodeBold />}
onClick={onOpen}
/>
2024-01-20 00:04:19 +00:00
</Tooltip>
);
2023-12-29 03:05:56 +00:00
});
AddEmbeddingButton.displayName = 'AddEmbeddingButton';