import React, { useState } from 'react'; function ApiKeyPage({ apiKey, onRegenerateApiKey }) { const [copySuccess, setCopySuccess] = useState(false); const handleCopyToClipboard = async () => { try { await navigator.clipboard.writeText(apiKey); setCopySuccess(true); setTimeout(() => setCopySuccess(false), 2000); } catch (err) { console.error('Failed to copy to clipboard:', err); // Fallback for older browsers const textArea = document.createElement('textarea'); textArea.value = apiKey; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); setCopySuccess(true); setTimeout(() => setCopySuccess(false), 2000); } }; return (
External tools can upload sample data remotely using the REST API. For remote clients, the API key is required for authentication:
{`curl -s -X POST \\
-H "Content-Type: application/json" \\
-H "Accept: application/json" \\
-H "X-API-Key: ${apiKey}" \\
--data @{{JSON_FILE_NAME}} \\
"${window.location.origin}/api/v1/upload"`}
{'{{JSON_FILE_NAME}}'} with the path to your JSON file containing the sample data.