Files
nice-app-web/src/entities/account/ui/account-user-tab.tsx
2025-09-29 10:51:17 +09:00

55 lines
1.5 KiB
TypeScript

import { PATHS } from '@/shared/constants/paths';
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
import {
AccountUserTabKeys,
AccountUserTabProps
} from '../model/types';
export const AccountUserTab = ({
activeTab,
mid,
usrid,
idCL,
status,
}: AccountUserTabProps) => {
const { navigate } = useNavigate();
const onClickToNavigation = (tab: AccountUserTabKeys) => {
if(activeTab !== tab){
if(tab === AccountUserTabKeys.LoginAuthInfo){
navigate(PATHS.account.user.loginAuthInfo, {
state: {
mid: mid,
usrid: usrid,
idCL: idCL,
status: status
}
});
}
else if(tab === AccountUserTabKeys.AccountAuth){
navigate(PATHS.account.user.accountAuth, {
state: {
mid: mid,
usrid: usrid,
idCL: idCL,
status: status
}
});
}
}
};
return(
<>
<div className="subTab">
<button
className={`subtab-btn ${(activeTab === AccountUserTabKeys.LoginAuthInfo)? 'active': ''}` }
onClick={ () => onClickToNavigation(AccountUserTabKeys.LoginAuthInfo) }
> </button>
<button
className={`subtab-btn ${(activeTab === AccountUserTabKeys.AccountAuth)? 'active': ''}` }
onClick={ () => onClickToNavigation( AccountUserTabKeys.AccountAuth) }
></button>
</div>
</>
);
};