mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-03 14:52:28 +08:00
fix: clear files when clicking text-only examples (#82)
Fixed an issue where files from previous examples would persist when clicking on "Animated Diagram" or "Creative Drawing" examples that don't require image uploads.
This commit is contained in:
@@ -90,7 +90,10 @@ export default function ExamplePanel({
|
|||||||
icon={<Zap className="w-4 h-4 text-primary" />}
|
icon={<Zap className="w-4 h-4 text-primary" />}
|
||||||
title="Animated Diagram"
|
title="Animated Diagram"
|
||||||
description="Draw a transformer architecture with animated connectors"
|
description="Draw a transformer architecture with animated connectors"
|
||||||
onClick={() => setInput("Give me a **animated connector** diagram of transformer's architecture")}
|
onClick={() => {
|
||||||
|
setInput("Give me a **animated connector** diagram of transformer's architecture")
|
||||||
|
setFiles([])
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ExampleCard
|
<ExampleCard
|
||||||
@@ -111,7 +114,10 @@ export default function ExamplePanel({
|
|||||||
icon={<Palette className="w-4 h-4 text-primary" />}
|
icon={<Palette className="w-4 h-4 text-primary" />}
|
||||||
title="Creative Drawing"
|
title="Creative Drawing"
|
||||||
description="Draw something fun and creative"
|
description="Draw something fun and creative"
|
||||||
onClick={() => setInput("Draw a cat for me")}
|
onClick={() => {
|
||||||
|
setInput("Draw a cat for me")
|
||||||
|
setFiles([])
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user