mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
minor: add a new example
This commit is contained in:
@@ -21,6 +21,23 @@ export default function ExamplePanel({
|
|||||||
console.error("Error loading example image:", error);
|
console.error("Error loading example image:", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handler for the "Replicate this in aws style" button
|
||||||
|
const handleReplicateArchitecture = async () => {
|
||||||
|
setInput("Replicate this in aws style");
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Fetch the architecture image
|
||||||
|
const response = await fetch("/architecture.png");
|
||||||
|
const blob = await response.blob();
|
||||||
|
const file = new File([blob], "architecture.png", { type: "image/png" });
|
||||||
|
|
||||||
|
// Set the file to the files state
|
||||||
|
setFiles([file]);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error loading architecture image:", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="px-4 py-2 border-t border-b border-gray-100">
|
<div className="px-4 py-2 border-t border-b border-gray-100">
|
||||||
<p className="text-sm text-gray-500 mb-2">
|
<p className="text-sm text-gray-500 mb-2">
|
||||||
@@ -33,6 +50,12 @@ export default function ExamplePanel({
|
|||||||
</p>
|
</p>
|
||||||
<p className="text-sm text-gray-500 mb-2">Try these examples:</p>
|
<p className="text-sm text-gray-500 mb-2">Try these examples:</p>
|
||||||
<div className="flex flex-wrap gap-5">
|
<div className="flex flex-wrap gap-5">
|
||||||
|
<button
|
||||||
|
className="text-xs bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-1 px-2 rounded"
|
||||||
|
onClick={handleReplicateArchitecture}
|
||||||
|
>
|
||||||
|
Replicate this in aws style
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
className="text-xs bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-1 px-2 rounded"
|
className="text-xs bg-gray-100 hover:bg-gray-200 text-gray-800 font-medium py-1 px-2 rounded"
|
||||||
onClick={handleReplicateFlowchart}
|
onClick={handleReplicateFlowchart}
|
||||||
|
|||||||
BIN
public/architecture.png
Normal file
BIN
public/architecture.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
Reference in New Issue
Block a user