(props: UseCanAwardUserProps)
| 28 | } |
| 29 | |
| 30 | export const useCanAwardUser = (props: UseCanAwardUserProps): boolean => { |
| 31 | const isSpecialUser = useIsSpecialUser({ |
| 32 | userId: props.receivingUser?.id ?? '', |
| 33 | }); |
| 34 | |
| 35 | const hasAccess = useCoresFeature(); |
| 36 | |
| 37 | if (!props.sendingUser || !props.receivingUser) { |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | const { sendingUser, receivingUser } = props; |
| 42 | |
| 43 | return ( |
| 44 | hasAccess && !isSpecialUser && canAwardUser({ sendingUser, receivingUser }) |
| 45 | ); |
| 46 | }; |
| 47 | |
| 48 | interface UseGetSquadAwardAdminProps { |
| 49 | sendingUser: LoggedUser; |
no test coverage detected