@@ -62,9 +62,6 @@ const staticCols = [
6262 colHelper . accessor ( 'timeCreated' , Columns . timeCreated ) ,
6363]
6464
65- const attachableStates = fancifyStates ( instanceCan . attachDisk . states )
66- const detachableStates = fancifyStates ( instanceCan . detachDisk . states )
67-
6865export function StorageTab ( ) {
6966 const [ showDiskCreate , setShowDiskCreate ] = useState ( false )
7067 const [ showDiskAttach , setShowDiskAttach ] = useState ( false )
@@ -128,7 +125,10 @@ export function StorageTab() {
128125 {
129126 label : 'Detach' ,
130127 disabled : ! instanceCan . detachDisk ( instance ) && (
131- < > Instance must be in state { detachableStates } before disk can be detached</ >
128+ < >
129+ Instance must be < span className = "text-default" > stopped</ span > before disk can
130+ be detached
131+ </ >
132132 ) ,
133133 onActivate ( ) {
134134 detachDisk . mutate ( { body : { disk : disk . name } , ...instancePathQuery } )
@@ -174,7 +174,12 @@ export function StorageTab() {
174174 < Button
175175 size = "sm"
176176 onClick = { ( ) => setShowDiskCreate ( true ) }
177- disabledReason = { < > Instance must be { attachableStates } to create a disk</ > }
177+ disabledReason = {
178+ < >
179+ Instance must be < span className = "text-default" > stopped</ span > to create and
180+ attach a disk
181+ </ >
182+ }
178183 disabled = { ! instanceCan . attachDisk ( instance ) }
179184 >
180185 Create new disk
@@ -183,15 +188,21 @@ export function StorageTab() {
183188 variant = "secondary"
184189 size = "sm"
185190 onClick = { ( ) => setShowDiskAttach ( true ) }
186- disabledReason = { < > Instance must be { attachableStates } to attach a disk</ > }
191+ disabledReason = {
192+ < >
193+ Instance must be < span className = "text-default" > stopped</ span > to attach a
194+ disk
195+ </ >
196+ }
187197 disabled = { ! instanceCan . attachDisk ( instance ) }
188198 >
189199 Attach existing disk
190200 </ Button >
191201 </ div >
192202 { ! instanceCan . attachDisk ( instance ) && (
193203 < span className = "max-w-xs text-sans-md text-tertiary" >
194- A disk cannot be added or attached unless the instance is { attachableStates } .
204+ The instance must be < span className = "text-default" > stopped</ span > to add or
205+ attach a disk.
195206 </ span >
196207 ) }
197208 </ div >
0 commit comments