2024-01-23 07:58:58 +00:00
|
|
|
import { FC } from "react";
|
2024-02-28 11:23:26 +00:00
|
|
|
import Link from "next/link";
|
2024-01-23 07:58:58 +00:00
|
|
|
// hooks
|
|
|
|
import { useIssueDetail } from "hooks/store";
|
|
|
|
|
|
|
|
type TIssueUser = {
|
|
|
|
activityId: string;
|
2024-02-28 11:23:26 +00:00
|
|
|
customUserName?: string;
|
2024-01-23 07:58:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const IssueUser: FC<TIssueUser> = (props) => {
|
2024-02-28 11:23:26 +00:00
|
|
|
const { activityId, customUserName } = props;
|
2024-01-23 07:58:58 +00:00
|
|
|
// hooks
|
|
|
|
const {
|
|
|
|
activity: { getActivityById },
|
|
|
|
} = useIssueDetail();
|
|
|
|
|
|
|
|
const activity = getActivityById(activityId);
|
|
|
|
|
|
|
|
if (!activity) return <></>;
|
2024-02-28 11:23:26 +00:00
|
|
|
|
2024-01-23 07:58:58 +00:00
|
|
|
return (
|
2024-02-28 11:23:26 +00:00
|
|
|
<>
|
|
|
|
{customUserName ? (
|
|
|
|
<span className="text-custom-text-100 font-medium">{customUserName}</span>
|
|
|
|
) : (
|
|
|
|
<Link
|
|
|
|
href={`/${activity?.workspace_detail?.slug}/profile/${activity?.actor_detail?.id}`}
|
|
|
|
className="hover:underline text-custom-text-100 font-medium"
|
|
|
|
>
|
|
|
|
{activity.actor_detail?.display_name}
|
|
|
|
</Link>
|
|
|
|
)}
|
|
|
|
</>
|
2024-01-23 07:58:58 +00:00
|
|
|
);
|
|
|
|
};
|