MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / loading

Function loading

frontend/src/screens/ProductScreen.js:52–89  ·  view source on GitHub ↗
(
        <div>Loading...</div>
      ) : error ? (
        <div>{error} </div>
      ) : (
        <>
          <div className="details">
            <div className="details-image">
              <img src={product.image} alt="product"></img>
            </div>
            <div className="details-info">
              <ul>
                <li>
                  <h4>{product.name}</h4>
                </li>
                <li>
                  <a href="#reviews">
                    <Rating
                      value={product.rating}
                      text={product.numReviews + ' reviews'}
                    />
                  </a>
                </li>
                <li>
                  Price: <b>${product.price}</b>
                </li>
                <li>
                  Description:
                  <div>{product.description}</div>
                </li>
              </ul>
            </div>
            <div className="details-action">
              <ul>
                <li>Price: {product.price}</li>
                <li>
                  Status:{' '}

Source from the content-addressed store, hash-verified

50 <Link to="/">Back to result</Link>
51 </div>
52 {loading ? (
53 <div>Loading...</div>
54 ) : error ? (
55 <div>{error} </div>
56 ) : (
57 <>
58 <div className="details">
59 <div className="details-image">
60 <img src={product.image} alt="product"></img>
61 </div>
62 <div className="details-info">
63 <ul>
64 <li>
65 <h4>{product.name}</h4>
66 </li>
67 <li>
68 <a href="#reviews">
69 <Rating
70 value={product.rating}
71 text={product.numReviews + ' reviews'}
72 />
73 </a>
74 </li>
75 <li>
76 Price: <b>${product.price}</b>
77 </li>
78 <li>
79 Description:
80 <div>{product.description}</div>
81 </li>
82 </ul>
83 </div>
84 <div className="details-action">
85 <ul>
86 <li>Price: {product.price}</li>
87 <li>
88 Status:{' '}
89 {product.countInStock > 0 ? 'In Stock' : 'Unavailable.'}
90 </li>
91 <li>
92 Qty:{' '}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected