openreplay/frontend/app/components/Dashboard/components/MetricsList/GridView.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

37 lines
1 KiB
TypeScript

import React from 'react';
import WidgetWrapper from 'App/components/Dashboard/components/WidgetWrapper';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import { withSiteId } from 'App/routes';
interface Props extends RouteComponentProps {
list: any;
siteId: any;
selectedList: any;
}
function GridView(props: Props) {
const { siteId, list, selectedList, history } = props;
const onItemClick = (metricId: number) => {
const path = withSiteId(`/metrics/${metricId}`, siteId);
history.push(path);
};
return (
<div className="grid grid-cols-4 gap-4 m-4 items-start">
{list.map((metric: any) => (
<React.Fragment key={metric.metricId}>
<WidgetWrapper
key={metric.metricId}
widget={metric}
isGridView
active={selectedList.includes(metric.metricId)}
isSaved
onClick={() => onItemClick(parseInt(metric.metricId))}
/>
</React.Fragment>
))}
</div>
);
}
export default withRouter(GridView);