2023-12-28 13:03:21 +00:00
|
|
|
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';
|
2023-12-28 13:03:21 +00:00
|
|
|
import { useTranslation } from 'react-i18next';
|
2024-01-18 04:08:38 +00:00
|
|
|
import { PiCodeBold } from 'react-icons/pi'
|
2023-12-28 13:03:21 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
isOpen: boolean;
|
|
|
|
onOpen: () => void;
|
|
|
|
};
|
|
|
|
|
2023-12-29 03:05:56 +00:00
|
|
|
export const AddEmbeddingButton = memo((props: Props) => {
|
2023-12-28 13:03:21 +00:00
|
|
|
const { onOpen, isOpen } = props;
|
|
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
|
|
<InvTooltip label={t('embedding.addEmbedding')}>
|
|
|
|
<InvIconButton
|
|
|
|
variant="promptOverlay"
|
|
|
|
isDisabled={isOpen}
|
|
|
|
aria-label={t('embedding.addEmbedding')}
|
2024-01-18 04:08:38 +00:00
|
|
|
icon={<PiCodeBold />}
|
2023-12-28 13:03:21 +00:00
|
|
|
onClick={onOpen}
|
|
|
|
/>
|
|
|
|
</InvTooltip>
|
|
|
|
);
|
2023-12-29 03:05:56 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
AddEmbeddingButton.displayName = 'AddEmbeddingButton';
|