KitPrimitives
useMoneyLabel
A figure's dictionary label (affiliate::money), for a surface that names it outside MoneyFigure.
import { useMoneyLabel } from '@ergasti/bricks';Examples
Names from the dictionary
useMoneyLabel() returns a function that gives the label the money notes dictionary has for a figure, for a column header or a chart legend that must match the "?" note.
Code
import { MoneyNotesProvider, useLanguage, useMoneyLabel } from '@ergasti/bricks';
import { moneyNotes } from './sample-data';
function Label() {
const label = useMoneyLabel();
return <p>wallet_held → <b>{label('wallet_held')}</b> · sales → <b>{label('sales')}</b></p>;
}
function Names() {
const language = useLanguage();
return <MoneyNotesProvider notes={moneyNotes(language)}><Label /></MoneyNotesProvider>;
}Signature
function useMoneyLabel(): (figure: MoneyFigureKey) => stringReturns
(figure: MoneyFigureKey) => string
Related
useBricks · useMoneyDisplay · useLanguage · MoneyNotesProvider · Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/MoneyNote.tsx (line 33) on GitHub.