Files
bigcapital/packages/webapp/src/components/Customers/CustomerDrawerLink.tsx
2023-06-14 19:51:14 +02:00

34 lines
759 B
TypeScript

// @ts-nocheck
import React from 'react';
import * as R from 'ramda';
import { ButtonLink } from '../Button';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { DRAWERS } from '@/constants/drawers';
function CustomerDrawerLinkComponent({
// #ownProps
children,
customerId,
className,
// #withDrawerActions
openDrawer,
}) {
// Handle view customer drawer.
const handleCustomerDrawer = (event) => {
openDrawer(DRAWERS.CUSTOMER_DETAILS, { customerId });
event.preventDefault();
};
return (
<ButtonLink className={className} onClick={handleCustomerDrawer}>
{children}
</ButtonLink>
);
}
export const CustomerDrawerLink = R.compose(withDrawerActions)(
CustomerDrawerLinkComponent,
);