mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Run eslint when the project is running to standardize everyone's code #9377 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
21 lines
483 B
TypeScript
21 lines
483 B
TypeScript
import { useCallback } from 'react';
|
|
import { useSearchParams } from 'umi';
|
|
|
|
export enum Step {
|
|
SignIn,
|
|
SignUp,
|
|
ForgotPassword,
|
|
ResetPassword,
|
|
VerifyEmail,
|
|
}
|
|
|
|
export const useSwitchStep = (step: Step) => {
|
|
const [_, setSearchParams] = useSearchParams();
|
|
console.log('🚀 ~ useSwitchStep ~ _:', _);
|
|
const switchStep = useCallback(() => {
|
|
setSearchParams(new URLSearchParams({ step: step.toString() }));
|
|
}, [setSearchParams, step]);
|
|
|
|
return { switchStep };
|
|
};
|