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 });
|
console.log({ result });
|
||||||
return result;
|
return result;
|
||||||
}}
|
}}
|
||||||
onCount={async () => {
|
onCount={async (params: any) => {
|
||||||
const result: any =
|
const result: any =
|
||||||
typeof onCount === "function"
|
typeof onCount === "function"
|
||||||
? await onCount({
|
? await onCount({
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ export const ListUI: React.FC<any> = ({
|
||||||
name={name}
|
name={name}
|
||||||
content={content}
|
content={content}
|
||||||
onLoad={onLoad}
|
onLoad={onLoad}
|
||||||
onCount={async () => {
|
onCount={async (params: any) => {
|
||||||
const result = await onCount();
|
const result = await onCount();
|
||||||
local.count = result;
|
local.count = result;
|
||||||
local.render();
|
local.render();
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ export const ListUIClean: React.FC<any> = ({
|
||||||
name={name}
|
name={name}
|
||||||
content={content}
|
content={content}
|
||||||
onLoad={onLoad}
|
onLoad={onLoad}
|
||||||
onCount={async () => {
|
onCount={async (params: any) => {
|
||||||
const result = await onCount();
|
const result = await onCount();
|
||||||
local.count = result;
|
local.count = result;
|
||||||
local.render();
|
local.render();
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,11 @@ export const TableEditBetter: React.FC<any> = ({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="flex items-center h-full flex-grow p-2">
|
<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>
|
</div>
|
||||||
</HeaderColumn>
|
</HeaderColumn>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue