@@ -46,62 +46,67 @@ export default () => {
4646 } ;
4747
4848 return (
49- < div className = { 'my-10 flex ' } >
49+ < div className = { 'my-10' } >
5050 < FlashMessageRender byKey = { 'account' } className = { 'mb-4' } />
51- < ContentBox title = { 'Create API Key' } className = { 'flex-1' } >
52- < CreateApiKeyForm onKeyCreated = { key => setKeys ( s => ( [ ...s ! , key ] ) ) } />
53- </ ContentBox >
54- < ContentBox title = { 'API Keys' } className = { 'ml-10 flex-1' } >
55- < SpinnerOverlay visible = { loading } />
56- { deleteIdentifier &&
57- < ConfirmationModal
58- title = { 'Confirm key deletion' }
59- buttonText = { 'Yes, delete key' }
60- visible = { true }
61- onConfirmed = { ( ) => {
62- doDeletion ( deleteIdentifier ) ;
63- setDeleteIdentifier ( '' ) ;
64- } }
65- onDismissed = { ( ) => setDeleteIdentifier ( '' ) }
66- >
67- Are you sure you wish to delete this API key? All requests using it will immediately be
68- invalidated and will fail.
69- </ ConfirmationModal >
70- }
71- {
72- keys . length === 0 ?
73- < p className = { 'text-center text-sm' } >
74- { loading ? 'Loading...' : 'No API keys exist for this account.' }
75- </ p >
76- :
77- keys . map ( key => (
78- < div key = { key . identifier } className = { 'grey-row-box bg-neutral-600 mb-2 flex items-center' } >
79- < FontAwesomeIcon icon = { faKey } className = { 'text-neutral-300' } />
80- < div className = { 'ml-4 flex-1' } >
81- < p className = { 'text-sm' } > { key . description } </ p >
82- < p className = { 'text-2xs text-neutral-300 uppercase' } >
83- Last
84- used: { key . lastUsedAt ? format ( key . lastUsedAt , 'MMM Do, YYYY HH:mm' ) : 'Never' }
51+ < div className = { 'flex' } >
52+ < ContentBox title = { 'Create API Key' } className = { 'flex-1' } >
53+ < CreateApiKeyForm onKeyCreated = { key => setKeys ( s => ( [ ...s ! , key ] ) ) } />
54+ </ ContentBox >
55+ < ContentBox title = { 'API Keys' } className = { 'ml-10 flex-1' } >
56+ < SpinnerOverlay visible = { loading } />
57+ { deleteIdentifier &&
58+ < ConfirmationModal
59+ title = { 'Confirm key deletion' }
60+ buttonText = { 'Yes, delete key' }
61+ visible = { true }
62+ onConfirmed = { ( ) => {
63+ doDeletion ( deleteIdentifier ) ;
64+ setDeleteIdentifier ( '' ) ;
65+ } }
66+ onDismissed = { ( ) => setDeleteIdentifier ( '' ) }
67+ >
68+ Are you sure you wish to delete this API key? All requests using it will immediately be
69+ invalidated and will fail.
70+ </ ConfirmationModal >
71+ }
72+ {
73+ keys . length === 0 ?
74+ < p className = { 'text-center text-sm' } >
75+ { loading ? 'Loading...' : 'No API keys exist for this account.' }
76+ </ p >
77+ :
78+ keys . map ( key => (
79+ < div
80+ key = { key . identifier }
81+ className = { 'grey-row-box bg-neutral-600 mb-2 flex items-center' }
82+ >
83+ < FontAwesomeIcon icon = { faKey } className = { 'text-neutral-300' } />
84+ < div className = { 'ml-4 flex-1' } >
85+ < p className = { 'text-sm' } > { key . description } </ p >
86+ < p className = { 'text-2xs text-neutral-300 uppercase' } >
87+ Last
88+ used: { key . lastUsedAt ? format ( key . lastUsedAt , 'MMM Do, YYYY HH:mm' ) : 'Never' }
89+ </ p >
90+ </ div >
91+ < p className = { 'text-sm ml-4' } >
92+ < code className = { 'font-mono py-1 px-2 bg-neutral-900 rounded' } >
93+ { key . identifier }
94+ </ code >
8595 </ p >
96+ < button
97+ className = { 'ml-4 p-2 text-sm' }
98+ onClick = { ( ) => setDeleteIdentifier ( key . identifier ) }
99+ >
100+ < FontAwesomeIcon
101+ icon = { faTrashAlt }
102+ className = { 'text-neutral-400 hover:text-red-400 transition-colors duration-150' }
103+ />
104+ </ button >
86105 </ div >
87- < p className = { 'text-sm ml-4' } >
88- < code className = { 'font-mono py-1 px-2 bg-neutral-900 rounded' } >
89- { key . identifier }
90- </ code >
91- </ p >
92- < button
93- className = { 'ml-4 p-2 text-sm' }
94- onClick = { ( ) => setDeleteIdentifier ( key . identifier ) }
95- >
96- < FontAwesomeIcon
97- icon = { faTrashAlt }
98- className = { 'text-neutral-400 hover:text-red-400 transition-colors duration-150' }
99- />
100- </ button >
101- </ div >
102- ) )
103- }
104- </ ContentBox >
106+ ) )
107+ }
108+ </ ContentBox >
109+ </ div >
105110 </ div >
106111 ) ;
107112} ;
0 commit comments