import InputError from '@/components/input-error'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent } from '@/components/ui/dialog'; import { Label } from '@/components/ui/label'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; import { SharedData } from '@/types/global'; import { Link, useForm } from '@inertiajs/react'; import React, { ReactNode, useState } from 'react'; import Layout from './Partials/Layout'; import Message from './Partials/Message'; import StepNavigator from './Partials/StepNavigator'; const Install = ({ flash }: SharedData) => { const [isLoading, setIsLoading] = useState(false); const [showModal, setShowModal] = useState(false); const { data, errors, post, processing, setData } = useForm({ course_creation: 'collaborative', }); const handleConfirm = (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); setShowModal(true); post(route('install.store-processing'), { onFinish() { setIsLoading(false); setShowModal(false); }, }); }; return (
{/* Step Navigator */} {/* Loading Message */} {isLoading && (
Loading...
)}
setData('course_creation', value)} >
{data.course_creation === 'collaborative' ? (

Collaborative Mode: Enable a collaborative platform where qualified users can become instructors and create their own courses. The platform administrator will receive a percentage of revenue from each instructor's course sales.

) : (

Administrative Mode: Centralize course management where only administrators can create and publish educational content. Students can enroll in these official courses, with all revenue flowing directly to the platform administration.

)}

Your app is currently undergoing an automatic installation. This process will take a few minutes. Please don't refresh your page or turn off your device. Just stay with this process.

); }; Install.layout = (page: ReactNode) => ; export default Install;