ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
20 lines • 1.18 kB
JavaScript
import * as React from 'react';
import { RecordContextProvider } from "../controller/record/index.js";
import { WithListContext } from "../controller/list/WithListContext.js";
export var SimpleList = function (_a) {
var children = _a.children, render = _a.render, _b = _a.inline, inline = _b === void 0 ? false : _b;
return (React.createElement(WithListContext, { render: function (_a) {
var data = _a.data, isPending = _a.isPending;
return isPending ? null : children ? (children) : (React.createElement("ul", { style: {
display: 'flex',
flexDirection: inline ? 'row' : 'column',
gap: '1em',
listStyle: 'none',
marginBlockStart: 0,
marginBlockEnd: 0,
paddingInlineStart: 0,
} }, data === null || data === void 0 ? void 0 : data.map(function (record) { return (React.createElement(RecordContextProvider, { key: record.id, value: record },
React.createElement("li", null, render ? render(record) : children))); })));
} }));
};
//# sourceMappingURL=SimpleList.js.map