Spaces:
Runtime error
Runtime error
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Prompt Details</title> | |
| </head> | |
| <body> | |
| <h1>Prompt Details</h1> | |
| <div id="prompt-container"></div> | |
| <script> | |
| const urlParams = new URLSearchParams(window.location.search); | |
| const promptId = urlParams.get('id'); | |
| // Fetch the prompt data dynamically (you can modify this part based on how you are storing prompts) | |
| fetch('/prompt/prompt.json') // Assuming prompts are stored in this file | |
| .then(response => response.json()) | |
| .then(prompts => { | |
| const prompt = prompts.find(p => p.id === promptId); | |
| if (prompt) { | |
| document.getElementById('prompt-container').innerHTML = ` | |
| <h2>Prompt ID: ${promptId}</h2> | |
| <p><strong>Prompt:</strong> ${prompt.prompt.replace(/\n/g, '<br>')}</p> | |
| `; | |
| } else { | |
| document.getElementById('prompt-container').innerText = "Prompt not found."; | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |