mirror of
https://github.com/plankanban/planka.git
synced 2025-12-21 01:11:26 +03:00
Initial commit
This commit is contained in:
49
client/src/components/ProjectWrapper.jsx
Executable file
49
client/src/components/ProjectWrapper.jsx
Executable file
@@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import ProjectContainer from '../containers/ProjectContainer';
|
||||
|
||||
const ProjectWrapper = React.memo(({ isProjectNotFound, isBoardNotFound, isCardNotFound }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
if (isCardNotFound) {
|
||||
return (
|
||||
<h1>
|
||||
{t('common.cardNotFound', {
|
||||
context: 'title',
|
||||
})}
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
|
||||
if (isBoardNotFound) {
|
||||
return (
|
||||
<h1>
|
||||
{t('common.boardNotFound', {
|
||||
context: 'title',
|
||||
})}
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
|
||||
if (isProjectNotFound) {
|
||||
return (
|
||||
<h1>
|
||||
{t('common.projectNotFound', {
|
||||
context: 'title',
|
||||
})}
|
||||
</h1>
|
||||
);
|
||||
}
|
||||
|
||||
return <ProjectContainer />;
|
||||
});
|
||||
|
||||
ProjectWrapper.propTypes = {
|
||||
isProjectNotFound: PropTypes.bool.isRequired,
|
||||
isBoardNotFound: PropTypes.bool.isRequired,
|
||||
isCardNotFound: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default ProjectWrapper;
|
||||
Reference in New Issue
Block a user