signal-desktop/ts/state/smart/VoiceNotesPlaybackProvider.tsx

23 lines
731 B
TypeScript
Raw Normal View History

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { connect } from 'react-redux';
import { mapDispatchToProps } from '../actions';
2023-02-24 23:18:57 +00:00
import { VoiceNotesPlaybackProvider } from '../../components/VoiceNotesPlaybackContext';
import type { StateType } from '../reducer';
import { getSelectedConversationId } from '../selectors/conversations';
2023-02-24 23:18:57 +00:00
import { isPaused } from '../selectors/audioPlayer';
const mapStateToProps = (state: StateType) => {
return {
conversationId: getSelectedConversationId(state),
isPaused: isPaused(state),
};
};
const smart = connect(mapStateToProps, mapDispatchToProps);
2023-02-24 23:18:57 +00:00
export const SmartVoiceNotesPlaybackProvider = smart(
VoiceNotesPlaybackProvider
);