Proyectos de Subversion LeadersLinked - Backend

Rev

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

import React from 'react'

const Location = ({ locations = [] }) => {

    const editLocation = (url) => { }

    const deleteLocation = (url) => { }

    return (
        <div className="user-profile-extended-ov st2">
            <h3>
                Ubicaciones
                <button className="btn btn-location-add">
                    <i className="fa fa-plus-square" />
                </button>
            </h3>
            <span id="locations-records">
                {
                    locations.map((location, index) => (
                        <>
                            <p key={index}>
                                {location.formatted_address}
                                {location.is_main === 'y' ? " (Principal)" : ""}
                                <button
                                    onClick={() => editLocation(location.link_edit)}
                                    className="btn btn-location-edit"
                                    style={{ padding: '.3rem' }}
                                >
                                    <i className="fa fa-pencil" />
                                </button>
                                <button
                                    onClick={() => deleteLocation(location.link_delete)}
                                    className="btn btn-location-delete"
                                    style={{ padding: '.3rem' }}
                                >
                                    <i className="fa fa-trash" />
                                </button>
                            </p>
                            {
                                locations[index + 1] && <hr />
                            }
                        </>
                    ))
                }
            </span>
        </div >
    )
}

export default Location