2021-07-21 20:08:17 +02:00
|
|
|
{{#if styled}}
|
|
|
|
import styled from 'styled-components'
|
|
|
|
{{else}}
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* {{name}}
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
{{#if useI18n}}
|
|
|
|
import { useIntl } from 'react-intl';
|
2021-07-23 12:32:58 +02:00
|
|
|
{{#unless plugin "===" "admin"}}
|
|
|
|
import { getTrad } from '../../utils';
|
|
|
|
{{/unless}}
|
2021-07-21 20:08:17 +02:00
|
|
|
{{/if}}
|
|
|
|
{{#if useRedux}}
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
2021-07-23 12:32:58 +02:00
|
|
|
import { select{{name}}Domain } from './selectors';
|
2021-07-21 20:08:17 +02:00
|
|
|
import { defaultAction } from './actions';
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if styled}}
|
|
|
|
const {{name}} = styled.{{ htmlTag }}``;
|
|
|
|
{{else}}
|
|
|
|
const {{name}} = () => {
|
|
|
|
{{#if useI18n}}
|
|
|
|
const { formatMessage } = useIntl();
|
|
|
|
{{/if}}
|
|
|
|
{{#if useRedux}}
|
|
|
|
const dispatch = useDispatch();
|
2021-07-23 12:32:58 +02:00
|
|
|
// eslint-disable-next-line no-unused-vars
|
2021-07-21 20:08:17 +02:00
|
|
|
const state = useSelector(select{{name}}Domain);
|
|
|
|
|
|
|
|
const handleClick = () => dispatch(defaultAction())
|
|
|
|
{{/if}}
|
2021-07-22 14:10:54 +02:00
|
|
|
{{#if useI18n "||" useRedux}}
|
2021-07-21 20:08:17 +02:00
|
|
|
|
2021-07-22 14:10:54 +02:00
|
|
|
{{/if}}
|
2021-07-21 20:08:17 +02:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
{{#if useRedux}}
|
2021-07-22 14:10:54 +02:00
|
|
|
<button type="button" onClick={handleClick}>{{titleCase name}}</button>
|
2021-07-21 20:08:17 +02:00
|
|
|
{{/if}}
|
|
|
|
{{#if useI18n}}
|
2021-07-23 12:32:58 +02:00
|
|
|
<p>{formatMessage({ id: {{#if plugin "===" "admin"~}}
|
|
|
|
'component.name'
|
|
|
|
{{~else~}}
|
|
|
|
getTrad('component.name')
|
|
|
|
{{~/if}}, defaultMessage: '{{titleCase name}}' })}</p>
|
2021-07-21 20:08:17 +02:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
{{name}}.propTypes = {};
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
export default {{name}};
|