Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function useMapConfig() {
const { config } = usePlugin('map'),
routeInfo = useRouteInfo(),
context = useRenderContext();
return routeMapConf(config, routeInfo, context);
}
export default function Detail() {
const reverse = useReverse(),
{ page, item_id } = useRouteInfo(),
{ Link } = useComponents();
return (
<div>
Edit
</div>
);
}
export default function List() {
const reverse = useReverse(),
{ list } = useRenderContext(),
{ page } = useRouteInfo(),
{ ListItemLink, Pagination } = useComponents();
return (
<div>
{list.map(row => (
{row.label}
))}
</div>
export default function Pagination() {
const reverse = useReverse(),
nav = useNav(),
{ multiple, page: pageNum, count, per_page } = useRenderContext(),
{ name: routeName, params } = useRouteInfo();
if (!(multiple && count && per_page)) {
return null;
}
const updateParams = newParams => {
nav(
reverse(
routeName,
{},
{
...params,
...newParams
}
)
);
function PropertyTable() {
const context = useRenderContext(),
{ page_config } = useRouteInfo(),
fields = page_config.form || [{ name: 'label' }];
return (
{fields.map(field => (
{field.label || field.name}
))}
<table>
</table>