forked from polka_billy/porridger
Moved useBook to useSend API
This commit is contained in:
@ -21,8 +21,10 @@ const styles = {
|
||||
} as CSSProperties,
|
||||
}
|
||||
|
||||
function AnnouncementDetails({ close, announcement: { id, name, category, bestBy, description, lat, lng, address, metro } }: AnnouncementDetailsProps) {
|
||||
const { handleBook, status: bookStatus } = useBook(id)
|
||||
function AnnouncementDetails({ close, announcement: {
|
||||
id, name, category, bestBy, description, lat, lng, address, metro
|
||||
} }: AnnouncementDetailsProps) {
|
||||
const { handleBook, bookButton } = useBook()
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -62,9 +64,7 @@ function AnnouncementDetails({ close, announcement: { id, name, category, bestBy
|
||||
</Modal.Body>
|
||||
|
||||
<Modal.Footer>
|
||||
<Button variant='success' onClick={() => void handleBook()}>
|
||||
{bookStatus || 'Забронировать'}
|
||||
</Button>
|
||||
<Button variant='success' onClick={() => void handleBook(id)} {...bookButton} />
|
||||
</Modal.Footer>
|
||||
</Modal.Dialog>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user