-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearchBook.tsx
62 lines (61 loc) · 2.57 KB
/
SearchBook.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { Link } from "react-router-dom";
import BookModel from "../../../models/BookModel"
export const SearchBook: React.FC<{ book: BookModel }> = (props) => {
return (
<div className='card mt-3 shadow p-3 mb-3 bg-body rounded'>
<div className='row g-0'>
<div className='col-md-2'>
<div className='d-none d-lg-block'>
{props.book.img ?
<img src={props.book.img}
width='123'
height='196'
alt='Book'
/>
:
<img src={require('../../../Images/BooksImages/book-luv2code-1000.png')}
width='123'
height='196'
alt='Book'
/>
}
</div>
<div className='d-lg-none d-flex justify-content-center
align-items-center'>
{props.book.img ?
<img src={props.book.img}
width='123'
height='196'
alt='Book'
/>
:
<img src={require('../../../Images/BooksImages/book-luv2code-1000.png')}
width='123'
height='196'
alt='Book'
/>
}
</div>
</div>
<div className='col-md-6'>
<div className='card-body'>
<h5 className='card-title'>
{props.book.author}
</h5>
<h4>
{props.book.title}
</h4>
<p className='card-text'>
{props.book.description}
</p>
</div>
</div>
<div className='col-md-4 d-flex justify-content-center align-items-center'>
<Link className='btn btn-md main-color text-white' to={`/checkout/${props.book.id}`}>
View Details
</Link>
</div>
</div>
</div>
);
}