@@ -48,24 +48,26 @@ function OfferForm({ onSubmit, discount }: OfferFormProps) {
4848 { ...discount }
4949 startDate = { discount . startDate ?? new Date ( Date . now ( ) ) }
5050 onSubmit = { onSubmit }
51+ submitButtonText = "Next"
5152 />
5253 </ >
5354 )
5455}
5556
5657type OfferFormDrawerProps = Parameters < typeof BaseDrawer > [ 0 ] & {
58+ value : InfoReply
5759 onSubmit : OfferFormProps [ "onSubmit" ]
5860}
5961
60- function OfferFormDrawer ( { onSubmit, children, ...drawerProps } : OfferFormDrawerProps ) {
62+ function OfferFormDrawer ( { value , onSubmit, children, ...drawerProps } : OfferFormDrawerProps ) {
6163 return (
6264 < BaseDrawer { ...drawerProps } trigger = { children } >
6365 < div className = "px-4 py-12" >
6466 < OfferForm
6567 discount = { {
66- endDate : new Date ( Date . now ( ) + 1_000_000_000 ) ,
68+ endDate : new Date ( Date . parse ( value . bill . maturity_date ) ) ,
6769 gross : {
68- value : new Big ( 21_000 ) ,
70+ value : new Big ( value . bill . sum ) ,
6971 currency : "sat" ,
7072 } ,
7173 } }
@@ -197,7 +199,6 @@ function QuoteActions({ value, isFetching }: { value: InfoReply; isFetching: boo
197199 }
198200
199201 return (
200- < >
201202 < div className = "flex items-center gap-2" >
202203 < DenyConfirmDrawer
203204 title = "Confirm denying quote"
@@ -219,6 +220,7 @@ function QuoteActions({ value, isFetching }: { value: InfoReply; isFetching: boo
219220 < OfferFormDrawer
220221 title = "Offer quote"
221222 description = "Make an offer to the current holder of this bill"
223+ value = { value }
222224 open = { offerFormDrawerOpen }
223225 onOpenChange = { setOfferFormDrawerOpen }
224226 onSubmit = { ( data ) => {
@@ -258,7 +260,6 @@ function QuoteActions({ value, isFetching }: { value: InfoReply; isFetching: boo
258260 </ div >
259261 </ OfferConfirmDrawer >
260262 </ div >
261- </ >
262263 )
263264}
264265
0 commit comments