mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
re-structure to monorepo.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// @ts-nocheck
|
||||
import React, { useCallback } from 'react';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
import { ListSelect, FormattedMessage as T } from '@/components';
|
||||
|
||||
export function PaymentReceiveListField({
|
||||
invoices,
|
||||
selectedInvoiceId,
|
||||
onInvoiceSelected,
|
||||
defaultSelectText = <T id={'select_invoice'} />,
|
||||
}) {
|
||||
const onInvoiceSelect = useCallback((_invoice) => {
|
||||
onInvoiceSelected && onInvoiceSelected(_invoice);
|
||||
});
|
||||
|
||||
const handleInvoiceRenderer = useCallback(
|
||||
(item, { handleClick }) => (
|
||||
<MenuItem id={item.id} name={item.name} onClick={handleClick} />
|
||||
),
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<ListSelect
|
||||
item={invoices}
|
||||
noResults={<MenuItem disabled={true} text={<T id={'no_results'} />} />}
|
||||
itemRenderer={handleInvoiceRenderer}
|
||||
popoverProps={{ minimal: true }}
|
||||
onItemSelect={onInvoiceSelect}
|
||||
selectedItem={`${selectedInvoiceId}`}
|
||||
selectedItemProp={'id'}
|
||||
textProp={'name'}
|
||||
defaultText={defaultSelectText}
|
||||
/>
|
||||
);
|
||||
}
|
||||
2
packages/webapp/src/components/PaymentReceive/index.ts
Normal file
2
packages/webapp/src/components/PaymentReceive/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// @ts-nocheck
|
||||
export * from './PaymentReceiveListField';
|
||||
Reference in New Issue
Block a user