UNPKG

plot-plan-designer

Version:

Design Editor Tools with React.js + ant.design + fabric.js

30 lines (29 loc) 1.39 kB
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { List, Button, Avatar } from 'antd'; import Icon from '../../icon/Icon'; class AnimationList extends Component { render() { const { animations, onEdit, onDelete } = this.props; return (React.createElement(List, { dataSource: animations, renderItem: (animation, index) => { const actions = [ React.createElement(Button, { key: 1, className: "rde-action-btn", shape: "circle", onClick: () => { onEdit(animation, index); } }, React.createElement(Icon, { name: "edit" })), React.createElement(Button, { key: 2, className: "rde-action-btn", shape: "circle", onClick: () => { onDelete(index); } }, React.createElement(Icon, { name: "times" })), ]; return (React.createElement(List.Item, { actions: actions }, React.createElement(List.Item.Meta, { avatar: React.createElement(Avatar, null, index), title: animation.title, description: animation.type }))); } })); } } AnimationList.propTypes = { animations: PropTypes.array, onEdit: PropTypes.func, onDelete: PropTypes.func, }; export default AnimationList;