بوت 3
import React, { useState } from 'react'; export default function App() { const [videoLink, setVideoLink] = useState(''); const [videos, setVideos] = useState([]); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); const handleAddVideo = (e) => { e.preventDefault(); if (!videoLink.trim()) { setError('Please enter a valid video link'); return; } setIsLoading(true); setError(''); // Simulate processing the video link setTimeout(() => { // Validate URL format try { new URL(videoLink); const newVideo = { id: Date.now(), url: videoLink, title: `Video ${videos.length + 1}`, thumbnail: `https://placehold.co/320x180/3b82f6/ffffff?text=Video+${videos.length + 1}`, addedDate: new Date().toLocaleDateString(), status: 'Added (Demo)' }; ...