Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions snippets/copy-prompt-button.jsx
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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);
Expand Down
Loading