mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-05 20:46:43 +00:00
ui-ux: prompt-enhanced-toast
ui-ux: prompt enhanced toast notification
This commit is contained in:
commit
d936c012bd
@ -27,6 +27,7 @@ import { ModelSelector } from '~/components/chat/ModelSelector';
|
|||||||
import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition';
|
import { SpeechRecognitionButton } from '~/components/chat/SpeechRecognition';
|
||||||
import type { IProviderSetting, ProviderInfo } from '~/types/model';
|
import type { IProviderSetting, ProviderInfo } from '~/types/model';
|
||||||
import { ScreenshotStateManager } from './ScreenshotStateManager';
|
import { ScreenshotStateManager } from './ScreenshotStateManager';
|
||||||
|
import { toast } from 'react-toastify';
|
||||||
|
|
||||||
const TEXTAREA_MIN_HEIGHT = 76;
|
const TEXTAREA_MIN_HEIGHT = 76;
|
||||||
|
|
||||||
@ -492,22 +493,16 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
|||||||
className={classNames(
|
className={classNames(
|
||||||
'transition-all',
|
'transition-all',
|
||||||
enhancingPrompt ? 'opacity-100' : '',
|
enhancingPrompt ? 'opacity-100' : '',
|
||||||
promptEnhanced ? 'text-bolt-elements-item-contentAccent' : '',
|
|
||||||
promptEnhanced ? 'pr-1.5' : '',
|
|
||||||
promptEnhanced ? 'enabled:hover:bg-bolt-elements-item-backgroundAccent' : '',
|
|
||||||
)}
|
)}
|
||||||
onClick={() => enhancePrompt?.()}
|
onClick={() => {
|
||||||
|
enhancePrompt?.();
|
||||||
|
toast.success('Prompt enhanced!');
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{enhancingPrompt ? (
|
{enhancingPrompt ? (
|
||||||
<>
|
<div className="i-svg-spinners:90-ring-with-bg text-bolt-elements-loader-progress text-xl animate-spin"></div>
|
||||||
<div className="i-svg-spinners:90-ring-with-bg text-bolt-elements-loader-progress text-xl animate-spin"></div>
|
|
||||||
<div className="ml-1.5">Enhancing prompt...</div>
|
|
||||||
</>
|
|
||||||
) : (
|
) : (
|
||||||
<>
|
<div className="i-bolt:stars text-xl"></div>
|
||||||
<div className="i-bolt:stars text-xl"></div>
|
|
||||||
{promptEnhanced && <div className="ml-1.5">Prompt enhanced</div>}
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user