Files
frontend-app-learner-dashboard/src/containers/CourseCard/components/CourseCardActions/SelectSessionButton.jsx
Jacobo Dominguez 0d2eb96c86 React query and react context conversion (#786)
Migrate from Redux to React Query and React Context.  This modernizes state management while maintaining all existing functionality.  All the redux code and files were removed, including all redux and related packages.
2026-03-03 12:45:57 -03:00

28 lines
837 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from '@edx/frontend-platform/i18n';
import { useSelectSessionModal } from 'data/context';
import useActionDisabledState from '../hooks';
import ActionButton from './ActionButton';
import messages from './messages';
export const SelectSessionButton = ({ cardId }) => {
const { formatMessage } = useIntl();
const { disableSelectSession } = useActionDisabledState(cardId);
const { updateSelectSessionModal } = useSelectSessionModal();
return (
<ActionButton
disabled={disableSelectSession}
onClick={() => updateSelectSessionModal(cardId)}
>
{formatMessage(messages.selectSession)}
</ActionButton>
);
};
SelectSessionButton.propTypes = {
cardId: PropTypes.string.isRequired,
};
export default SelectSessionButton;