45 request.codeParameter
46 }`
47
48 switch (triggerSource) {49 case 'CustomMessage_AdminCreateUser':50 case 'CustomMessage_ResendCode':51 case 'CustomMessage_SignUp': {52 response.emailSubject = subject53 response.emailMessage = `${message} ${confirmLink}`54 break55 }56 case 'CustomMessage_ForgotPassword': {57 response.emailSubject = subject58 response.emailMessage = `${message} ${resetLink}`59 break60 }61 }62 const reply = { ...event, response }
63
64 logger.info(JSON.stringify(response))
79
80 const handleTabChange = useCallback((tab: string) => {
81 setActiveTab(tab)
82 switch (tab) { 83 case 'services': { 84 servicesRef.current?.scrollIntoView({ behavior: 'smooth' }) 85 break 86 } 87 case 'photos': { 88 photosRef.current?.scrollIntoView({ behavior: 'smooth' }) 89 break 90 } 91 case 'reviews': { 92 reviewsRef.current?.scrollIntoView({ behavior: 'smooth' }) 93 break 94 } 95 } 96 }, [])
97
98 const renderSidebar = useCallback(
68
69 const handleTabChange = useCallback((tab: Tabname) => {
70 setActiveTab(tab)
71 switch (tab) { 72 case 'services': { 73 servicesRef.current?.scrollIntoView({ behavior: 'smooth' }) 74 break 75 } 76 case 'photos': { 77 photosRef.current?.scrollIntoView({ behavior: 'smooth' }) 78 break 79 } 80 case 'reviews': { 81 reviewsRef.current?.scrollIntoView({ behavior: 'smooth' }) 82 break 83 } 84 } 85 }, [])
86
87 if (loading || !data || !orgData || router.isFallback) {
116
117 const tabHandler = useCallback((tab: string) => {
118 setActiveTab(tab)
119 switch (tab) {120 case 'services': {121 servicesRef.current?.scrollIntoView({ behavior: 'smooth' })122 break123 }124 case 'photos': {125 photosRef.current?.scrollIntoView({ behavior: 'smooth' })126 break127 }128 case 'reviews': {129 reviewsRef.current?.scrollIntoView({ behavior: 'smooth' })130 break131 }132 }133 }, [])
134
135 if (loading || !data) {
86 return t('common:words.close')
87 }
88 case 'back': {
89 switch (backTo) { 90 case 'search': { 91 return t('common:breadcrumb.back-to-search') 92 } 93 case 'none': { 94 return t('common:words.back') 95 } 96 case 'dynamicText': { 97 const page = backToText 98 if (isMobile) { 99 return t('common:words.back')100 }101 return (102 <Trans103 i18nKey='breadcrumb.back-to-dynamic'104 ns='common'105 values={{ page }}106 shouldUnescape={true}107 components={{ u: <u>.</u> }}108 />109 )110 }111 }112 }
113 // eslint-disable-next-line no-fallthrough
114 default:
Some code conventions require that all switch statements have a default case, even if the default case is empty. The idea is to always explicitly state what the default behavior should be so that it's clear that the developer didn't forget to handle the default fallback case.
switch (a) {
case 1:
/* code */
break;
}
switch (a) {
case 1:
/* code */
break;
default:
/* code */
break;
}
switch (a) {
case 1:
/* code */
break;
// no default
}
switch (a) {
case 1:
/* code */
break;
// No Default
}