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.

29 lines
795 B
TypeScript
Raw Normal View History

import { InvIconButton } from 'common/components/InvIconButton/InvIconButton';
import { InvTooltip } from 'common/components/InvTooltip/InvTooltip';
2023-12-29 03:05:56 +00:00
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { FaCode } from 'react-icons/fa';
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 (
<InvTooltip label={t('embedding.addEmbedding')}>
<InvIconButton
variant="promptOverlay"
isDisabled={isOpen}
aria-label={t('embedding.addEmbedding')}
icon={<FaCode />}
onClick={onOpen}
/>
</InvTooltip>
);
2023-12-29 03:05:56 +00:00
});
AddEmbeddingButton.displayName = 'AddEmbeddingButton';