@@ -38,14 +38,16 @@ const Page = () => {
38
38
const [ exam , setExam ] = useState ( "" ) ;
39
39
const [ year , setYear ] = useState ( "" ) ;
40
40
const [ files , setFiles ] = useState < File [ ] > ( [ ] ) ;
41
+ const [ inputValue , setInputValue ] = useState ( '' )
42
+
41
43
const [ isSubjectCommandOpen , setIsSubjectCommandOpen ] = useState ( false ) ;
42
44
// const toggleOpenCamera = () => {
43
45
// setOpenCamera((prev) => !prev);
44
46
// };
45
47
46
48
const handlePrint = async ( ) => {
47
49
const maxFileSize = 5 * 1024 * 1024 ;
48
- const allowedFileTypes = [ "application/pdf" , "image/jpeg" , "image/png" , "image/gif" ] ;
50
+ // const allowedFileTypes = ["application/pdf", "image/jpeg", "image/png", "image/gif"];
49
51
const files = fileInputRef . current ?. files as FileList | null ;
50
52
51
53
if ( ! files || files . length === 0 ) {
@@ -62,10 +64,10 @@ const Page = () => {
62
64
return ;
63
65
}
64
66
65
- if ( ! allowedFileTypes . includes ( file . type ) ) {
66
- toast . error ( `File type of ${ file . name } is not allowed. Only PDFs and images are accepted.` ) ;
67
- return ;
68
- }
67
+ // if (!allowedFileTypes.includes(file.type)) {
68
+ // toast.error(`File type of ${file.name} is not allowed. Only PDFs and images are accepted.`);
69
+ // return;
70
+ // }
69
71
}
70
72
71
73
const formData = new FormData ( ) ;
@@ -92,7 +94,7 @@ const Page = () => {
92
94
) ;
93
95
return response . data ;
94
96
} catch ( error ) {
95
- handleAPIError ( error ) ;
97
+ throw handleAPIError ( error ) ;
96
98
}
97
99
} ) ( ) ,
98
100
{
@@ -193,7 +195,10 @@ const Page = () => {
193
195
)}
194
196
</div> */ }
195
197
< Command className = "rounded-lg border shadow-md md:min-w-[450px]" >
196
- < CommandInput placeholder = "Type a subject or search..." />
198
+ < CommandInput
199
+ value = { inputValue }
200
+ onChangeCapture = { ( e ) => setInputValue ( ( e . target as HTMLInputElement ) . value ) }
201
+ placeholder = "Type a subject or search..." />
197
202
< CommandList className = "h-[100px]" >
198
203
< CommandEmpty > No results found.</ CommandEmpty >
199
204
0 commit comments