mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
32 lines
696 B
JavaScript
32 lines
696 B
JavaScript
import React from 'react';
|
|
import * as R from 'ramda';
|
|
|
|
import { ButtonLink } from '../Button';
|
|
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
|
|
|
function CustomerDrawerLinkComponent({
|
|
// #ownProps
|
|
children,
|
|
customerId,
|
|
className,
|
|
|
|
// #withDrawerActions
|
|
openDrawer,
|
|
}) {
|
|
// Handle view customer drawer.
|
|
const handleCustomerDrawer = (event) => {
|
|
openDrawer('customer-details-drawer', { customerId });
|
|
event.preventDefault();
|
|
};
|
|
|
|
return (
|
|
<ButtonLink className={className} onClick={handleCustomerDrawer}>
|
|
{children}
|
|
</ButtonLink>
|
|
);
|
|
}
|
|
|
|
export const CustomerDrawerLink = R.compose(withDrawerActions)(
|
|
CustomerDrawerLinkComponent,
|
|
);
|