react-code-dataset / wp-calypso /client /landing /subscriptions /tracks /use-record-comment-notifications-toggle.tsx
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
import useRecordSubscriptionsTracksEvent from './use-record-subscriptions-tracks-event';
const useRecordCommentNotificationsToggle = () => {
const recordSubscriptionsTracksEvent = useRecordSubscriptionsTracksEvent();
const recordCommentNotificationsToggle = (
enabled: boolean,
tracksProps: {
blog_id: string | null;
post_id: number | null;
}
) => {
if ( enabled ) {
recordSubscriptionsTracksEvent(
'calypso_subscriptions_comment_notifications_toggle_on',
tracksProps
);
} else {
recordSubscriptionsTracksEvent(
'calypso_subscriptions_comment_notifications_toggle_off',
tracksProps
);
}
};
return recordCommentNotificationsToggle;
};
export default useRecordCommentNotificationsToggle;