openreplay/frontend/app/components/shared/MainSearchBar/MainSearchBar.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

25 lines
733 B
TypeScript

import React from 'react';
import SessionFilters from 'Shared/SessionFilters';
import { useStore } from 'App/mstore';
import { observer } from 'mobx-react-lite';
function MainSearchBar() {
const { searchStore, projectsStore } = useStore();
const projectId = projectsStore.siteId;
const currSite = React.useRef(projectId);
React.useEffect(() => {
if (projectId !== currSite.current && currSite.current !== undefined) {
console.debug('clearing filters due to project change');
searchStore.clearSearch();
currSite.current = projectId;
}
}, [projectId]);
return (
<div className="flex flex-col gap-2 w-full">
<SessionFilters />
</div>
);
}
export default observer(MainSearchBar);