1
1
import * as React from 'react'
2
2
import {
3
- PageSection , Bullseye , Text , TextContent , TextVariants ,
3
+ PageSection , Bullseye , Text , TextContent , TextVariants ,
4
4
Card , CardTitle , CardBody , CardFooter
5
5
} from '@patternfly/react-core'
6
6
import { useDocumentTitle } from '@app/utils/useDocumentTitle'
7
7
import Footer from '@app/components/Footer'
8
- import DetailsView from '@app/components/DetailsView'
8
+ import { DetailsView } from '@app/components/DetailsView'
9
9
import { useState , useEffect } from 'react'
10
10
import { useParams } from 'react-router-dom'
11
11
import fetch from 'cross-fetch'
12
12
13
- const ImageDetails : React . FunctionComponent < { title : string } > = ( { title} ) => {
13
+ const ImageDetails : React . FunctionComponent < { title : string } > = ( { title } ) => {
14
14
const [ details , setDetails ] = useState ( { } )
15
15
const { provider, region, imageName } = useParams ( )
16
16
useDocumentTitle ( title )
@@ -19,24 +19,24 @@ const ImageDetails: React.FunctionComponent<{title: string}> = ({title}) => {
19
19
fetch ( `https://imagedirectory.cloud/images/v1/${ provider } /${ region } /${ imageName } ` , {
20
20
method : 'get' ,
21
21
} )
22
- . then ( res => res . json ( ) )
23
- . then ( details => setDetails ( details ) )
22
+ . then ( res => res . json ( ) )
23
+ . then ( details => setDetails ( details ) )
24
24
} , [ provider , region , imageName ] )
25
25
26
26
return (
27
27
< div >
28
28
< PageSection isFilled = { true } >
29
- < Bullseye >
30
- < Card
31
- style = { {
32
- width : 800 ,
33
- display : 'flex' ,
34
- justifyContent : 'center' ,
35
- } } >
36
- < CardBody isFilled = { false } >
37
- { details [ 'imageId' ] ? < DetailsView details = { { ...details , provider : provider } } /> : < div > Loading....</ div > }
38
- </ CardBody >
39
- </ Card >
29
+ < Bullseye >
30
+ < Card
31
+ style = { {
32
+ width : 800 ,
33
+ display : 'flex' ,
34
+ justifyContent : 'center' ,
35
+ } } >
36
+ < CardBody isFilled = { false } >
37
+ { details [ 'imageId' ] ? < DetailsView details = { { ...details , provider : provider } } /> : < div > Loading....</ div > }
38
+ </ CardBody >
39
+ </ Card >
40
40
</ Bullseye >
41
41
</ PageSection >
42
42
< Footer />
0 commit comments