summaryrefslogtreecommitdiff
path: root/src/components/addresses_table.tsx
blob: ea7d840b1c8a5b73c89b7436d347735cd14a6d8d (plain)
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
import Address from "./address";

export default function AddressesTable({ addresses }) {
  const digested_addresses = addresses.map(address => 
    <Address address={address}/>
  );

  return(
    <div className="w-4/5 relative overflow-x-auto">
      <h1 className="text-2xl my-2">
        Direcciones de envío
      </h1>
      <div className="absolute top-0 right-0">
        <a type="button" className="focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800"
          href="/account/addresses/new">
          Nueva dirección
        </a>
      </div>
      <table className="w-full text-sm text-left text-gray-500 dark:text-gray-400">
        <thead className="bg-blue-arma text-xs text-white uppercase dark:bg-gray-700 dark:text-gray-400">
        <tr>
          <th scope="col" className="px-6 py-3">
            Calle
          </th>
          <th scope="col" className="px-6 py-3">
            Número
          </th>
          <th scope="col" className="px-6 py-3">
            Código postal
          </th>
          <th scope="col" className="px-6 py-3">
            Ciudad
          </th>
          <th scope="col" className="px-6 py-3">
            País
          </th>
          <th scope="col" className="px-6 py-3">
            Editar
          </th>
        </tr>
        </thead>
        <tbody>
          {digested_addresses}
        </tbody>
      </table>
    </div>
  );
}