{t('qgj.learning-plans.desc.logged-out')}
;\n }\n\n /**\n * If we are loading, or if we have an error, or if we have no data, we show the message\n */\n if ((isValidating && !data) || error || (data?.count ?? 0) === 0) {\n return{t('qgj.learning-plans.desc.logged-in-no-plans')}
;\n }\n // user has at least 1 plan\n return{t('qgj.learning-plans.desc.logged-in')}
;\n};\n\nexport default LearningPlans;\n","import React from 'react';\n\nimport useTranslation from 'next-translate/useTranslation';\nimport useSWRImmutable from 'swr/immutable';\n\nimport styles from './CallToActionButtons.module.scss';\n\nimport Button, { ButtonSize, ButtonType } from '@/dls/Button/Button';\nimport { getUserCoursesCount } from '@/utils/auth/api';\nimport { makeGetUserCoursesCountUrl } from '@/utils/auth/apiPaths';\nimport { isLoggedIn } from '@/utils/auth/login';\nimport { logButtonClick } from '@/utils/eventLogger';\nimport { getCoursesNavigationUrl, getMyCoursesNavigationUrl } from '@/utils/navigation';\n\nconst LearningPlansButtons = () => {\n const { t } = useTranslation('home');\n const { data, isValidating, error } = useSWRImmutable(\n isLoggedIn() ? makeGetUserCoursesCountUrl() : null,\n async () => {\n const response = await getUserCoursesCount();\n return response;\n },\n );\n\n const onViewPlansButtonClicked = (e) => {\n // don't toggle collapsible parent when clicking\n e.stopPropagation();\n logButtonClick('homepage_qgj_view_plans');\n };\n\n const onMyPlansButtonClicked = (e) => {\n e.stopPropagation();\n logButtonClick('homepage_qgj_my_plans');\n };\n\n const viewPlansButton = (\n \n );\n\n if (!isLoggedIn()) {\n return{t('home:qgj.quran-reading-goals.desc.logged-out')}
;\n }\n\n return (\n{t('qgj.title')}
\n\n