1-
21import { ViewConfig } from '@vaadin/hilla-file-router/types.js' ;
3- import { Button , Card , Notification , Upload , UploadElement } from '@vaadin/react-components' ;
4- import { useEffect , useRef } from 'react' ;
52
63export const config : ViewConfig = {
74 title : "Sign Key" ,
@@ -13,39 +10,12 @@ const getMyCsrfHeaders: () => Record<string, string> = () => {
1310 return { 'X-CSRF-Token' : token } ;
1411}
1512
16- const maxFileSizeInMB = 10 ;
17- const maxFileSizeInBytes = maxFileSizeInMB * 1024 * 1024 ;
18-
1913export default function MainView ( ) {
2014 const csrfHeaders = getMyCsrfHeaders ( ) ;
21- const uploadRef = useRef < UploadElement > ( null ) ;
22-
23- useEffect ( ( ) => {
24- if ( ! uploadRef . current ) {
25- return ;
26- }
27- uploadRef . current . i18n . addFiles . many = 'Select Files...' ;
28- uploadRef . current . i18n = { ...uploadRef . current . i18n } ;
29- } , [ uploadRef . current ] ) ;
30-
3115
3216 return (
3317 < >
34- < Card theme = "elevated" >
35- < div slot = "title" > Upload user key</ div >
36- < div slot = "subtitle" > Only upload the public key</ div >
37- < Upload
38- target = "/rest/upload/file"
39- accept = ".pub"
40- maxFiles = { 1 }
41- maxFileSize = { maxFileSizeInBytes }
42- onFileReject = { ( event ) => {
43- Notification . show ( event . detail . error ) ;
44- } }
45- headers = { csrfHeaders }
46- />
47- < Button theme = "primary" > Submit</ Button >
48- </ Card >
18+ < span > Under Construction</ span >
4919 </ >
5020 ) ;
51- }
21+ }
0 commit comments