Download wp-calypso/client/landing/subscriptions/helpers/index.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 327 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/subscriptions/helpers/index.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/subscriptions/helpers/index.ts
-
curl -L -o index.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/subscriptions/helpers/index.ts
327 Bytes
| import type { Option } from 'calypso/landing/subscriptions/components/sort-controls'; | |
| export const getOptionLabel = < T >( options: Option< T >[], value: T ) => { | |
| const foundOption = options.find( ( option ) => option.value === value )?.label; | |
| if ( ! foundOption ) { | |
| return options[ 0 ].label; | |
| } | |
| return foundOption; | |
| }; | |