mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 23:59:45 +08:00
fix(sonner.stories): inline mock promise in loading toast story
This commit is contained in:
parent
49607908fa
commit
0b7f4f341e
@ -206,17 +206,15 @@ export const Warning: Story = {
|
||||
|
||||
export const Loading: Story = {
|
||||
render: () => {
|
||||
const mockPromise = new Promise((resolve) => {
|
||||
setTimeout(() => resolve('Data loaded'), 2000)
|
||||
})
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<Button
|
||||
onClick={() =>
|
||||
toast.loading('Loading...', {
|
||||
description: 'Please wait while we process your request.',
|
||||
promise: mockPromise
|
||||
promise: new Promise((resolve) => {
|
||||
setTimeout(() => resolve('Data loaded'), 2000)
|
||||
})
|
||||
})
|
||||
}>
|
||||
Show Loading Toast
|
||||
|
||||
Loading…
Reference in New Issue
Block a user