UNPKG

@wulperstudio/cms

Version:
23 lines 914 B
import React from 'react'; import { v4 } from 'uuid'; import { WrapperComponent, SnapCenter } from './styled'; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export var List = function List(props) { var _props$type = props.type, type = _props$type === void 0 ? 'horizontal' : _props$type, _props$variant = props.variant, variant = _props$variant === void 0 ? 'unlimited' : _props$variant, _props$limit = props.limit, limit = _props$limit === void 0 ? 25 : _props$limit; var limited = variant === 'limited' ? props.data.slice(0, limit) : props.data; return /*#__PURE__*/_jsxs(WrapperComponent, { type: type, children: [limited.map(function (item) { return /*#__PURE__*/_jsx(SnapCenter, { children: props.children(item) }, v4()); }), variant === 'limited' && /*#__PURE__*/_jsxs("div", { children: ["Hola:", ' ', limit] })] }); };