= 2 ? "border-t border-[var(--border-subtle)]" : "",
- index >= 2 && index % 2 === 1 ? "md:border-l" : "",
+ index > 0 ? "border-t border-[var(--border-subtle)]" : "",
+ index % 2 === 1 ? "md:border-l" : "",
+ index === 1 ? "md:border-t-0" : "",
].join(" ").trim()}
>
@@ -319,3 +319,57 @@ export function ProfileDepartmentBadge({
);
}
+
+export function ProfileDepartmentsCard({
+ title = "Отделы",
+ departments,
+}: {
+ title?: string;
+ departments: EmployeeDepartment[];
+}) {
+ if (!departments.length) {
+ return null;
+ }
+
+ return (
+
+
+
+
+ {departments.map((department) => (
+
+
+ {department.name}
+
+ {department.role_name ? (
+
+ {department.role_name}
+
+ ) : null}
+ {department.is_head ? (
+
+
+
+ ) : null}
+ {department.via_assignment ? (
+
+
+
+ ) : null}
+
+ ))}
+
+
+
+ );
+}
diff --git a/frontend/src/hooks/useProfilePage.ts b/frontend/src/hooks/useProfilePage.ts
index 221ae23c..707a87e5 100644
--- a/frontend/src/hooks/useProfilePage.ts
+++ b/frontend/src/hooks/useProfilePage.ts
@@ -409,11 +409,13 @@ export function useProfilePage(): ProfilePageController {
value: formatProfileDate(user?.created_at),
},
{
- label: "Последний вход",
- value: formatProfileDateTime(user?.last_login),
+ label: "Последняя активность",
+ value: formatProfileDateTime(
+ user?.last_activity_at || user?.last_login,
+ ),
},
],
- [user?.created_at, user?.date_joined, user?.last_login],
+ [user?.created_at, user?.date_joined, user?.last_activity_at, user?.last_login],
);
const onInputSkillName = useCallback((value: string) => {
diff --git a/frontend/src/types/api.ts b/frontend/src/types/api.ts
index f74d3dc9..d191a4f4 100644
--- a/frontend/src/types/api.ts
+++ b/frontend/src/types/api.ts
@@ -51,6 +51,7 @@ export interface User {
created_at?: string;
updated_at?: string;
last_login?: string;
+ last_activity_at?: string;
date_joined?: string;
auth?: {
id?: number;