InvokeAI/invokeai/frontend/web/src/features/prompt/AddPromptTriggerButton.tsx

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

28 lines
720 B
TypeScript
Raw Normal View History

import { IconButton, Tooltip } from '@invoke-ai/ui-library';
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;
};
export const AddPromptTriggerButton = memo((props: Props) => {
const { onOpen, isOpen } = props;
const { t } = useTranslation();
return (
<Tooltip label={t('prompt.addPromptTrigger')}>
2024-01-20 00:04:19 +00:00
<IconButton
variant="promptOverlay"
isDisabled={isOpen}
aria-label={t('prompt.addPromptTrigger')}
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
});
AddPromptTriggerButton.displayName = 'AddPromptTriggerButton';