@fakel/rest-admin
Version:
An application that makes it easier to work with your API
16 lines (15 loc) • 619 B
JavaScript
import React from 'react';
import Button from 'antd/lib/button';
import { useHistory } from 'react-router-dom';
import { useResourceStore } from '../../hooks/useResourceStore';
import { withI18 } from '../../hoc/withI18';
var CreateButton = function (_a) {
var style = _a.style, text = _a.text;
var resourceStore = useResourceStore();
var history = useHistory();
var onClick = function () {
history.push("/" + resourceStore.current + "/create");
};
return (React.createElement(Button, { style: style, type: "primary", onClick: onClick }, text));
};
export default withI18(CreateButton);