88 SheetTitle ,
99 SheetTrigger ,
1010} from "@/components/ui/sheet" ;
11+ import { TabButtons } from "@/components/ui/tabs" ;
1112import { ListerOnly } from "@3rdweb-sdk/react/components/roles/lister-only" ;
1213import { PlusIcon } from "lucide-react" ;
1314import { useState } from "react" ;
@@ -21,6 +22,8 @@ interface CreateListingButtonProps {
2122 type ?: "direct-listings" | "english-auctions" ;
2223}
2324
25+ const LISTING_MODES = [ "Select NFT" , "Manual" ] as const ;
26+
2427export const CreateListingButton : React . FC < CreateListingButtonProps > = ( {
2528 createText = "Create" ,
2629 type,
@@ -29,6 +32,8 @@ export const CreateListingButton: React.FC<CreateListingButtonProps> = ({
2932} ) => {
3033 const address = useActiveAccount ( ) ?. address ;
3134 const [ open , setOpen ] = useState ( false ) ;
35+ const [ listingMode , setListingMode ] =
36+ useState < ( typeof LISTING_MODES ) [ number ] > ( "Select NFT" ) ;
3237
3338 return (
3439 < ListerOnly contract = { contract } >
@@ -40,14 +45,27 @@ export const CreateListingButton: React.FC<CreateListingButtonProps> = ({
4045 </ SheetTrigger >
4146 < SheetContent className = "w-full overflow-y-auto sm:min-w-[540px] lg:min-w-[700px]" >
4247 < SheetHeader >
43- < SheetTitle className = "mb-5 text-left" > { createText } </ SheetTitle >
48+ < SheetTitle className = "mb-3 text-left" > { createText } </ SheetTitle >
4449 </ SheetHeader >
45- < CreateListingsForm
46- contract = { contract }
47- type = { type }
48- actionText = { createText }
49- setOpen = { setOpen }
50+ < TabButtons
51+ tabs = { LISTING_MODES . map ( ( mode ) => ( {
52+ name : mode ,
53+ isActive : mode === listingMode ,
54+ onClick : ( ) => setListingMode ( mode ) ,
55+ isEnabled : true ,
56+ } ) ) }
57+ tabClassName = "text-sm gap-2 !text-sm"
58+ tabContainerClassName = "gap-0.5"
5059 />
60+ < div className = "mt-5" >
61+ < CreateListingsForm
62+ contract = { contract }
63+ type = { type }
64+ actionText = { createText }
65+ setOpen = { setOpen }
66+ mode = { listingMode === "Select NFT" ? "automatic" : "manual" }
67+ />
68+ </ div >
5169 </ SheetContent >
5270 </ Sheet >
5371 </ ListerOnly >
0 commit comments