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
|
2024-03-19 14:38:35 +00:00
|
|
|
import { useIssueDetail } from "@/hooks/store";
|
2024-01-23 07:58:58 +00:00
|
|
|
|
|
|
|
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
|
|
|
);
|
|
|
|
};
|