11import classNames from 'classnames'
22import { Dispatch , FC , SetStateAction , useEffect , useState } from 'react'
33
4- import { Button } from '../../../../lib'
4+ import { Button , ButtonStyle } from '../../../../lib'
55import {
66 CourseTitle ,
77 LearnCertification ,
@@ -20,6 +20,8 @@ interface CoursesCardProps {
2020
2121const CoursesCard : FC < CoursesCardProps > = ( props : CoursesCardProps ) => {
2222
23+ const [ buttonStyle , setButtonStyle ] : [ ButtonStyle , Dispatch < SetStateAction < ButtonStyle > > ]
24+ = useState < ButtonStyle > ( 'primary' )
2325 const [ buttonLabel , setButtonLabel ] : [ string , Dispatch < SetStateAction < string > > ]
2426 = useState < string > ( '' )
2527 const [ link , setLink ] : [ string , Dispatch < SetStateAction < string > > ]
@@ -42,6 +44,7 @@ const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
4244
4345 if ( isCompleted ) {
4446 // if the course is completed, View the Certificate
47+ setButtonStyle ( 'secondary' )
4548 setButtonLabel ( 'View Certificate' )
4649 setLink ( getCertificatePath (
4750 props . certification . providerName ,
@@ -58,6 +61,7 @@ const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
5861
5962 } else {
6063 // otherwise this course is in-progress, so Resume the course at the next lesson
64+ setButtonStyle ( 'secondary' )
6165 setButtonLabel ( 'Resume' )
6266 setLink ( getLessonPathFromCurrentLesson (
6367 props . certification . providerName ,
@@ -85,7 +89,7 @@ const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
8589 < div className = { styles [ 'bottom' ] } >
8690 { ! ! link && (
8791 < Button
88- buttonStyle = 'primary'
92+ buttonStyle = { buttonStyle }
8993 size = 'sm'
9094 label = { buttonLabel }
9195 route = { link }
0 commit comments