Extract property-field-common module
[arvados-workbench2.git] / src / views-components / resource-properties-form / property-field-common.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { connect } from 'react-redux';
6 import { Vocabulary } from '~/models/vocabulary';
7 import { RootState } from '~/store/store';
8 import { getVocabulary } from '~/store/vocabulary/vocabulary-selctors';
9
10 export interface VocabularyProp {
11     vocabulary: Vocabulary;
12 }
13
14 export const mapStateToProps = (state: RootState): VocabularyProp => ({
15     vocabulary: getVocabulary(state.properties),
16 });
17
18 export const connectVocabulary = connect(mapStateToProps);
19
20 export const ITEMS_PLACEHOLDER: string[] = [];