// Dashboard/Courses/CourseDetail.jsx function CourseDetail({ courseId, onBack }) { const [course, setCourse] = React.useState(null); React.useEffect(() => { if (!courseId) return; fetch("Dashboard/Courses/courses.json") .then((r) => r.json()) .then((data) => { const found = data.find((c) => c.id === courseId); setCourse(found || null); }) .catch(() => setCourse(null)); }, [courseId]); if (!course) { return (
Курс не найден
{course.summary}