diff --git a/snippets/copy-prompt-button.jsx b/snippets/copy-prompt-button.jsx index 5092c4b..bb59480 100644 --- a/snippets/copy-prompt-button.jsx +++ b/snippets/copy-prompt-button.jsx @@ -1,6 +1,10 @@ const { useState, useCallback } = React; -const DEFAULT_PROMPT = `# Setup Kernel +export const CopyPromptButton = (props) => { + const { label = 'copy prompt' } = props || {}; + const [copied, setCopied] = useState(false); + + const prompt = (props && props.prompt) || `# Setup Kernel ## Prerequisites - Read the kernel-cli skill at https://github.com/kernel/skills/blob/main/plugins/kernel-cli/skills/kernel-cli/SKILL.md for reference on commands and capabilities. @@ -27,10 +31,6 @@ const DEFAULT_PROMPT = `# Setup Kernel - Tell the user they can use the live view immediately. - If browser creation fails, stop and ask the user for help.`; -export const CopyPromptButton = (props) => { - const { prompt = DEFAULT_PROMPT, label = 'copy prompt' } = props || {}; - const [copied, setCopied] = useState(false); - const handleCopy = useCallback(async () => { try { await navigator.clipboard.writeText(prompt);