File tree Expand file tree Collapse file tree
app/(dashboard)/admin/products Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ const DashboardProductDetails = ({
144144 < div className = "flex flex-col gap-y-7 xl:ml-5 w-full max-xl:px-5" >
145145 < h1 className = "text-3xl font-semibold" > Product details</ h1 >
146146 { /* Product name input div - start */ }
147+
147148 < div >
148149 < label className = "form-control w-full max-w-xs" >
149150 < div className = "label" >
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import toast from "react-hot-toast";
99
1010const AddNewProduct = ( ) => {
1111 const [ product , setProduct ] = useState < {
12+ merchantId ?: string ;
1213 title : string ;
1314 price : number ;
1415 manufacturer : string ;
@@ -18,6 +19,7 @@ const AddNewProduct = () => {
1819 slug : string ;
1920 categoryId : string ;
2021 } > ( {
22+ merchantId : "" ,
2123 title : "" ,
2224 price : 0 ,
2325 manufacturer : "" ,
@@ -28,7 +30,7 @@ const AddNewProduct = () => {
2830 categoryId : "" ,
2931 } ) ;
3032 const [ categories , setCategories ] = useState < Category [ ] > ( [ ] ) ;
31-
33+ const [ merchants , setMerchants ] = useState < Merchant [ ] > ( [ ] ) ;
3234 const addProduct = async ( ) => {
3335 if (
3436 product . title === "" ||
@@ -121,6 +123,22 @@ const AddNewProduct = () => {
121123 < DashboardSidebar />
122124 < div className = "flex flex-col gap-y-7 xl:ml-5 max-xl:px-5 w-full" >
123125 < h1 className = "text-3xl font-semibold" > Add new product</ h1 >
126+ < div >
127+ < label className = "form-control w-full max-w-xs" >
128+ < div className = "label" >
129+ < span className = "label-text" > Merchant Info:</ span >
130+ </ div >
131+ < input
132+ type = "text"
133+ className = "input input-bordered w-full max-w-xs"
134+ value = { product ?. title }
135+ onChange = { ( e ) =>
136+ setProduct ( { ...product , title : e . target . value } )
137+ }
138+ />
139+ </ label >
140+ </ div >
141+
124142 < div >
125143 < label className = "form-control w-full max-w-xs" >
126144 < div className = "label" >
You can’t perform that action at this time.
0 commit comments