File size: 384 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;