2023-02-03 08:30:24 +03:00

22 lines
598 B
TypeScript

import { useQuery } from '@apollo/client';
import * as CRMTypes from 'graphql/crm.types';
import { observer } from 'mobx-react-lite';
import { useStore } from 'stores/hooks';
const CurrencyAddon = observer(() => {
const { $calculation } = useStore();
const currencyid = $calculation.element('selectSupplierCurrency').getValue();
const { data } = useQuery(CRMTypes.GetTransactionCurrencyDocument, {
variables: {
currencyid: currencyid!,
},
skip: !currencyid,
});
return <span>{data?.transactioncurrency?.currencysymbol}</span>;
});
export default <CurrencyAddon />;