diff --git a/components/PromptPanel.tsx b/components/PromptPanel.tsx index e6d275b..ac8f3ca 100644 --- a/components/PromptPanel.tsx +++ b/components/PromptPanel.tsx @@ -2,6 +2,8 @@ import PromptEntry from "./PromptEntry"; import { AppState, PlayingState, InferenceResult, PromptInput } from "../types"; import { useRef } from "react"; +import { samplePrompts, rollTheDicePrompts } from "../prompts"; + interface PromptPanelProps { prompts: PromptInput[]; @@ -145,6 +147,14 @@ export default function PromptPanel({ } }; + const rollTheDice = () => { + const prompts = [...samplePrompts, ...rollTheDicePrompts]; + + const selectedPrompt = prompts[Math.floor(Math.random() * prompts.length)]; + + inputPrompt.current.value = selectedPrompt; + } + return ( <>
@@ -193,6 +203,11 @@ export default function PromptPanel({ autoComplete="off" /> +
+
+ +
+