mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-06-13 15:11:05 +00:00
16 lines
457 B
TypeScript
16 lines
457 B
TypeScript
// Copyright 2017-2026 @pezkuwi/app-society authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { Bid } from '@pezkuwi/types/interfaces';
|
|
|
|
import { createNamedHook, useApi, useCall } from '@pezkuwi/react-hooks';
|
|
|
|
function useCounterImpl (): number {
|
|
const { api } = useApi();
|
|
const bids = useCall<Bid[]>(api.query.society?.candidates);
|
|
|
|
return bids?.length || 0;
|
|
}
|
|
|
|
export default createNamedHook('useCounter', useCounterImpl);
|