import type { FC } from 'react'; import { useEffect } from 'react'; interface WithoutSelectedServerProps { resetSelectedServer: Function; } export function withoutSelectedServer(WrappedComponent: FC) { return (props: WithoutSelectedServerProps & T) => { const { resetSelectedServer } = props; useEffect(() => { resetSelectedServer(); }, []); return ; }; }