Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6019 | Rev 7774 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
6002 stevensc 1
import React from 'react'
2
 
6024 stevensc 3
const Location = ({ locations = [] }) => {
6002 stevensc 4
 
5
    const editLocation = (url) => { }
6
 
7
    const deleteLocation = (url) => { }
8
 
9
    return (
6024 stevensc 10
        <div className="user-profile-extended-ov st2">
6002 stevensc 11
            <h3>
12
                Ubicaciones
6024 stevensc 13
                <button className="btn btn-location-add">
14
                    <i className="fa fa-plus-square" />
6002 stevensc 15
                </button>
16
            </h3>
17
            <span id="locations-records">
18
                {
6024 stevensc 19
                    locations.map((location, index) => (
20
                        <>
21
                            <p key={index}>
6002 stevensc 22
                                {location.formatted_address}
6019 stevensc 23
                                {location.is_main === 'y' ? " (Principal)" : ""}
6002 stevensc 24
                                <button
25
                                    onClick={() => editLocation(location.link_edit)}
6024 stevensc 26
                                    className="btn btn-location-edit"
27
                                    style={{ padding: '.3rem' }}
6002 stevensc 28
                                >
6024 stevensc 29
                                    <i className="fa fa-pencil" />
6002 stevensc 30
                                </button>
31
                                <button
32
                                    onClick={() => deleteLocation(location.link_delete)}
6024 stevensc 33
                                    className="btn btn-location-delete"
34
                                    style={{ padding: '.3rem' }}
6002 stevensc 35
                                >
6024 stevensc 36
                                    <i className="fa fa-trash" />
6002 stevensc 37
                                </button>
38
                            </p>
6024 stevensc 39
                            {
40
                                locations[index + 1] && <hr />
41
                            }
42
                        </>
43
                    ))
6002 stevensc 44
                }
45
            </span>
46
        </div >
47
    )
48
}
49
 
50
export default Location