mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
34 lines
743 B
TypeScript
34 lines
743 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 VendorDrawerLinkComponent({
|
|
// #ownProps
|
|
children,
|
|
vendorId,
|
|
className,
|
|
|
|
// #withDrawerActions
|
|
openDrawer,
|
|
}) {
|
|
// Handle view customer drawer.
|
|
const handleVendorDrawer = (event) => {
|
|
openDrawer(DRAWERS.VENDOR_DETAILS, { vendorId });
|
|
event.preventDefault();
|
|
};
|
|
|
|
return (
|
|
<ButtonLink className={className} onClick={handleVendorDrawer}>
|
|
{children}
|
|
</ButtonLink>
|
|
);
|
|
}
|
|
|
|
export const VendorDrawerLink = R.compose(withDrawerActions)(
|
|
VendorDrawerLinkComponent,
|
|
);
|