1
- import React from "react "
2
- import { Box , Flex , type FlexProps , Text } from "@chakra- ui/react "
1
+ import { TwImage as Image } from "@/components/Image "
2
+ import { Flex , type FlexProps } from "@/components/ ui/flex "
3
3
4
- import { Image } from "@/components/Image "
4
+ import { cn } from "@/lib/utils/cn "
5
5
6
6
import type { NFT } from "./interfaces"
7
7
@@ -11,26 +11,21 @@ type NFTListProps = FlexProps & {
11
11
nfts : Array < NFT >
12
12
}
13
13
export const NFTList = ( { nfts, ...flexProps } : NFTListProps ) => {
14
- const size = useBreakpointValue ( { base : 20 , md : 24 } )
14
+ const size = useBreakpointValue ( {
15
+ base : "max-w-20 max-h-20" ,
16
+ md : "max-w-24 max-h-24" ,
17
+ } )
15
18
return (
16
- < Flex w = " full" gap = { 4 } h = "full" flexWrap = "wrap " { ...flexProps } >
19
+ < Flex className = "size- full flex-wrap gap-4 " { ...flexProps } >
17
20
{ nfts . length ? (
18
21
nfts . map ( ( { title, image } ) => (
19
- < Box key = { title } w = "fit-content" >
20
- < Image
21
- src = { image }
22
- alt = ""
23
- objectFit = "contain"
24
- maxW = { size }
25
- maxH = { size }
26
- />
27
- < Text fontSize = "xs" m = { 0 } >
28
- { title }
29
- </ Text >
30
- </ Box >
22
+ < div key = { title } className = "w-fit" >
23
+ < Image src = { image } alt = "" className = { cn ( "object-contain" , size ) } />
24
+ < p className = "text-xs" > { title } </ p >
25
+ </ div >
31
26
) )
32
27
) : (
33
- < Text > No NFTs yet!</ Text >
28
+ < p > No NFTs yet!</ p >
34
29
) }
35
30
</ Flex >
36
31
)
0 commit comments