This commit is contained in:
natib21
2026-07-17 13:10:27 +00:00
parent 6f126a2345
commit 0d98ccb04b
8 changed files with 151 additions and 82 deletions

View File

@@ -281,9 +281,9 @@ export const TeamMembers = ({
};
const ActionDropdown = ({ employee }: { employee: TeamMemberDto }) => {
const status = getUserStatus(employee);
const isPending = status === "pending";
const isNotInvited = status === "Not Invited";
// getUserStatus only ever yields "accepted" | "pending" — a member with no
// password set is "pending", so anything else has one already.
const isPending = getUserStatus(employee) === "pending";
return (
<DropdownMenu>
@@ -328,8 +328,11 @@ export const TeamMembers = ({
{t("positions.viewPositions")}
</DropdownMenuItem>
{/* Resend/Invite Option */}
{onInviteEmployee && (isPending || isNotInvited) && (
{/* Resend/Invite Option. Offered for accepted members too: the code
this sends lets them set a new password, so for someone who
already has one it is a reset — labelled as such rather than as an
invite, which would misdescribe what the operator is doing. */}
{onInviteEmployee && (
<DropdownMenuItem
onClick={(e) => {
e.stopPropagation();
@@ -337,7 +340,7 @@ export const TeamMembers = ({
}}
className="cursor-pointer dark:text-gray-200 dark:hover:bg-gray-600">
<RefreshCw className="h-4 w-4 mr-2" />
{isPending ? t("Resend Invite") : t("Send Invite")}
{isPending ? t("Resend Invite") : t("Send Password Reset")}
</DropdownMenuItem>
)}