openreplay/frontend/app/components/Header/NewProjectButton/NewProjectButton.tsx
Andrey Babushkin fd5c0c9747
Add lokalisation (#3092)
* applied eslint

* add locales and lint the project

* removed error boundary

* updated locales

* fix min files

* fix locales
2025-03-06 17:43:15 +01:00

28 lines
813 B
TypeScript

import { observer } from 'mobx-react-lite';
import React from 'react';
import NewSiteForm from 'App/components/Client/Sites/NewSiteForm';
import { useModal } from 'App/components/Modal';
import { useStore } from 'App/mstore';
import { Icon } from 'UI';
import { useTranslation } from 'react-i18next';
function NewProjectButton() {
const { t } = useTranslation();
const { projectsStore } = useStore();
const { showModal, hideModal } = useModal();
const onClick = () => {
projectsStore.initProject({});
showModal(<NewSiteForm onClose={hideModal} />, { right: true });
};
return (
<li onClick={onClick}>
<Icon name="folder-plus" size="16" color="teal" />
<span className="ml-3 color-teal">{t('Add Project')}</span>
</li>
);
}
export default observer(NewProjectButton);