1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import {TOGGLE_BUTTON_TYPE} from '../constants'; export const getToggleButtonText: ( button_type: string, state: boolean, ) => string | null = (button_type, state) => { switch (button_type) { case TOGGLE_BUTTON_TYPE.FOLLOW_UNFOLLOW: return state ? 'Unfollow' : 'Follow'; case TOGGLE_BUTTON_TYPE.BLOCK_UNBLOCK: return state ? 'Unblock' : 'Block'; default: return null; } };