diff options
Diffstat (limited to 'src/services/transforms.ts')
-rw-r--r-- | src/services/transforms.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/services/transforms.ts b/src/services/transforms.ts new file mode 100644 index 0000000..2eea46f --- /dev/null +++ b/src/services/transforms.ts @@ -0,0 +1,21 @@ +import _ from 'lodash'; +import { Field } from '../components/ListTable'; + +type Transformer = Field['transform']; + +const transformer = (hash: Record<string, string | JSX.Element>): Transformer => { + return value => _.get(hash, value, value); +}; + + +export const transformOperation = transformer({ + in: 'Приход', + out: 'Расход', +}); + +export const transformStatus = transformer({ + waiting: 'Ожидание', + executed: 'Проведена', + cancelled: 'Отменена', +}); + |