react-code-dataset / wp-calypso /packages /data-stores /src /plans /hooks /use-current-plan-expiry-date.ts
react-code-dataset / wp-calypso /packages /data-stores /src /plans /hooks /use-current-plan-expiry-date.ts
Download wp-calypso/packages/data-stores/src/plans/hooks/use-current-plan-expiry-date.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 384 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/plans/hooks/use-current-plan-expiry-date.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/data-stores/src/plans/hooks/use-current-plan-expiry-date.ts
-
curl -L -o use-current-plan-expiry-date.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/data-stores/src/plans/hooks/use-current-plan-expiry-date.ts
384 Bytes
| import useCurrentPlan from './use-current-plan'; | |
| interface Props { | |
| siteId?: string | number | null; | |
| } | |
| const useCurrentPlanExpiryDate = ( { siteId }: Props ): Date | undefined => { | |
| const currentPlan = useCurrentPlan( { siteId } ); | |
| if ( ! currentPlan || ! currentPlan?.expiry ) { | |
| return; | |
| } | |
| return new Date( currentPlan?.expiry ); | |
| }; | |
| export default useCurrentPlanExpiryDate; | |