import React from "react"; import PropTypes from "prop-types"; import { SortableContainer, SortableElement, SortableHandle, } from "react-sortable-hoc"; import ColorControl from "../color-control"; const { __ } = wp.i18n; const DEFAULT_PROFILE_COLOR = "#9f9f9f"; const TrashIcon = ({ position, onDeleteProfile }) => ( onDeleteProfile(position)} > ); const DragHandle = SortableHandle(() => ( )); const SortableItem = SortableElement( ({ position, profile, onProfileClick, onDeleteProfile, onColorChange, selectedIcon, url, onUrlChange, onSubmit, }) => (
  • onProfileClick(profile.icon)} > {profile.icon} {selectedIcon === profile.icon && profile.isExpanded && (
    onColorChange(color, position)} /> onUrlChange(event, profile.icon)} />
    )}
  • ) ); const SortableList = SortableContainer((props) => { const { profiles, ...rest } = props; return ( ); }); const SortableComponent = ({ profiles, onSortEnd, ...rest }) => { if (profiles.length === 0) return