openreplay/frontend/app/components/ui/Link/Link.js
2024-07-02 15:04:05 +05:30

20 lines
No EOL
670 B
JavaScript

import React from 'react';
import { Link } from 'react-router-dom';
import { connect } from 'react-redux';
import cn from 'classnames';
import { withSiteId } from 'App/routes';
import styles from './link.module.css';
const OpenReplayLink = ({ siteId, to, className="", dispatch, ...other }) => (
<Link
{ ...other }
className={ cn(className, styles.link , 'px-2', 'rounded-lg', 'hover:text-inherit', 'hover:bg-amber-50', 'hover:shadow-sm') }
to={ withSiteId(to, siteId) }
/>
);
OpenReplayLink.displayName = 'OpenReplayLink';
export default connect((state, props) => ({
siteId: props.siteId || state.getIn([ 'site', 'siteId' ])
}))(OpenReplayLink);