fix: update onCount prop to accept parameters for improved functionality in Typeahead and List components
This commit is contained in:
parent
b5e0598a2e
commit
e614c4b82c
|
|
@ -270,7 +270,7 @@ export const TypeaheadOptionsBetter: FC<{
|
|||
console.log({ result });
|
||||
return result;
|
||||
}}
|
||||
onCount={async () => {
|
||||
onCount={async (params: any) => {
|
||||
const result: any =
|
||||
typeof onCount === "function"
|
||||
? await onCount({
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export const ListUI: React.FC<any> = ({
|
|||
name={name}
|
||||
content={content}
|
||||
onLoad={onLoad}
|
||||
onCount={async () => {
|
||||
onCount={async (params: any) => {
|
||||
const result = await onCount();
|
||||
local.count = result;
|
||||
local.render();
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export const ListUIClean: React.FC<any> = ({
|
|||
name={name}
|
||||
content={content}
|
||||
onLoad={onLoad}
|
||||
onCount={async () => {
|
||||
onCount={async (params: any) => {
|
||||
const result = await onCount();
|
||||
local.count = result;
|
||||
local.render();
|
||||
|
|
|
|||
|
|
@ -261,7 +261,11 @@ export const TableEditBetter: React.FC<any> = ({
|
|||
}
|
||||
>
|
||||
<div className="flex items-center h-full flex-grow p-2">
|
||||
<span>{col?.header()}</span>
|
||||
<span>
|
||||
{typeof col?.header === "function"
|
||||
? col?.header()
|
||||
: col.header}
|
||||
</span>
|
||||
</div>
|
||||
</HeaderColumn>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue