@@ -13,22 +13,17 @@ const CreateConference: React.FC = () => {
13
13
setMessage ( 'Vous devez écrire un contexte.' ) ;
14
14
return ;
15
15
}
16
-
17
- if ( / ^ \d + $ / . test ( title ) ) {
18
- setMessage ( 'Le titre ne doit pas contenir que des chiffres.' ) ;
19
- return ;
20
- }
21
16
22
17
setIsLoading ( true ) ;
23
18
setMessage ( 'Création en cours...' ) ;
24
19
25
20
try {
26
- const response = await fetch ( 'https://api-generateconference.azurewebsites.net// Conference/CreateConference' , {
21
+ const response = await fetch ( 'https://api-generateconference.azurewebsites.net/Conference/CreateConference' , {
27
22
method : 'POST' ,
28
23
headers : {
29
24
'Content-Type' : 'application/json'
30
25
} ,
31
- body : JSON . stringify ( { Prompt : title } )
26
+ body : JSON . stringify ( { Prompt : title } )
32
27
} ) ;
33
28
34
29
if ( response . ok ) {
@@ -44,22 +39,36 @@ const CreateConference: React.FC = () => {
44
39
} ;
45
40
46
41
return (
47
- < div >
48
- < h1 > Création d'une conférence</ h1 >
49
- < form onSubmit = { handleSubmit } >
42
+ < div className = "flex flex-col items-center justify-center min-h-screen bg-gray-100 space-y-10" >
43
+ < h1 className = "text-4xl font-bold text-blue-600" >
44
+ Création d'une conférence
45
+ </ h1 >
46
+ < div className = "flex flex-col items-center space-y-4" >
50
47
< input
51
48
type = "text"
52
49
value = { title }
53
50
onChange = { ( e ) => setTitle ( e . target . value ) }
54
51
disabled = { isLoading }
55
52
required
53
+ className = "px-4 py-2 border border-gray-300 rounded-md"
56
54
/>
57
- < button type = "submit" disabled = { isLoading } >
58
- Créer la conférence
55
+ < button
56
+ type = "submit"
57
+ disabled = { isLoading }
58
+ className = "px-6 py-3 bg-blue-500 text-white rounded-lg shadow-md hover:bg-blue-600 transition-colors duration-200"
59
+ >
60
+ Envoyer
59
61
</ button >
60
- </ form >
62
+ </ div >
61
63
< p > { message } </ p >
62
- < Link to = "/" > Retourner au menu principal</ Link >
64
+ { ! isLoading && (
65
+ < Link
66
+ to = "/"
67
+ className = "px-6 py-3 bg-green-500 text-white rounded-lg shadow-md hover:bg-green-600 transition-colors duration-200"
68
+ >
69
+ Retourner à l'accueil
70
+ </ Link >
71
+ ) }
63
72
</ div >
64
73
) ;
65
74
} ;
0 commit comments