( link: string, context?: RichTranslationValues )
| 24 | // Provides Context replacement for variables within the Link. This is also something that is not going |
| 25 | // to happen in the future with `nodejs/nodejs.dev` codebase |
| 26 | const replaceLinkWithContext = ( |
| 27 | link: string, |
| 28 | context?: RichTranslationValues |
| 29 | ) => |
| 30 | Object.entries(context || {}).reduce( |
| 31 | (finalLink, [find, replace]) => |
| 32 | finalLink.replace( |
| 33 | `{${find}}`, |
| 34 | typeof replace === 'string' ? replace : '' |
| 35 | ), |
| 36 | link |
| 37 | ); |
| 38 | |
| 39 | const useSiteNavigation = () => { |
| 40 | const t = useTranslations(); |
no outgoing calls
no test coverage detected