import React from 'react'; import Dropdown from '../components/Dropdown'; const Widgets: React.FC<{ widgetScreenshot: File | null; onWidgetScreenshotChange: (screenshot: File | null) => void; }> = ({ widgetScreenshot, onWidgetScreenshotChange }) => { const widgetSources = ['Source 1', 'Source 2', 'Source 3']; const widgetMethods = ['Method 1', 'Method 2', 'Method 3']; const widgetTypes = ['Type 1', 'Type 2', 'Type 3']; const [selectedWidgetSource, setSelectedWidgetSource] = React.useState( widgetSources[0], ); const [selectedWidgetMethod, setSelectedWidgetMethod] = React.useState( widgetMethods[0], ); const [selectedWidgetType, setSelectedWidgetType] = React.useState( widgetTypes[0], ); // const [widgetScreenshot, setWidgetScreenshot] = useState(null); const [widgetCode, setWidgetCode] = React.useState(''); // Your widget code state const handleScreenshotChange = ( event: React.ChangeEvent, ) => { const files = event.target.files; if (files && files.length > 0) { const selectedScreenshot = files[0]; onWidgetScreenshotChange(selectedScreenshot); // Update the screenshot in the parent component } }; const handleCopyToClipboard = () => { // Create a new textarea element to select the text const textArea = document.createElement('textarea'); textArea.value = widgetCode; document.body.appendChild(textArea); // Select and copy the text textArea.select(); document.execCommand('copy'); // Clean up the textarea element document.body.removeChild(textArea); }; return (

Widget Source

Widget Method

Widget Type

Widget Code Snippet