diff --git a/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.interface.ts b/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.interface.ts index 34c7b48d..1c18f50d 100644 --- a/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.interface.ts +++ b/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.interface.ts @@ -1,5 +1,7 @@ -import { Employee } from '../../People.interface'; +import { Option } from '@app/types/common'; +import { Employee, PeopleStatus } from '../../People.interface'; export interface PeopleTableProps { people: Employee[]; + currentTab?: Option; } diff --git a/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.tsx b/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.tsx index b1306769..31cc4568 100644 --- a/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.tsx +++ b/frontend/src/components/pages/People/Modules/PeopleTable/PeopleTable.tsx @@ -7,10 +7,16 @@ import Link from 'next/link'; import { employeeMenuOptions } from '../../People.utils'; import { PeopleTableProps } from './PeopleTable.interface'; import { Avatar } from '@app/components/common/Avatar'; -import { getInitials } from '@app/utils'; +import { generateClassNames, getInitials } from '@app/utils'; import { formatDate } from '@app/utils'; +import { PeopleStatus } from '../../People.interface'; +import { Button } from '@app/components/common/Button'; + +export const PeopleTable: FC = ({ people, currentTab }) => { + const draft = currentTab?.id === PeopleStatus.drafts; + const deactivated = currentTab?.id === PeopleStatus.deactivated; + const active = currentTab?.id === PeopleStatus.active; -export const PeopleTable: FC = ({ people }) => { return (
@@ -18,28 +24,57 @@ export const PeopleTable: FC = ({ people }) => { - - - - - - - - + )} + {active && ( + <> + + + + + + )} + @@ -80,61 +115,86 @@ export const PeopleTable: FC = ({ people }) => { ))} - + )} + {draft && ( + + )} + {active && ( + <> + - + + - - - + + )} +
+ Employee + Ladder + Current Band - Active Goal - - Goal Progress - - Pending actions - - Last activity date - + {draft && ( + + Action + + Active Goal + + Goal Progress + + Pending actions + + Last activity date + Edit
-
- {person?.laddersDetails?.map((ladder) => ( -
- {ladder?.activeGoal && } + {active && ( +
+
+ {person?.laddersDetails?.map((ladder) => ( +
+ {ladder?.activeGoal && } +
+ ))} +
+
+
+ + +
+
+
+ {person?.laddersDetails?.map((ladder) => ( +
+ {ladder.activeGoal && ( + <> +
+
+
+ + {ladder.goalProgress}% + + + )} +
+ ))}
- ))} -
-
-
- {person?.laddersDetails?.map((ladder) => ( -
- {ladder.activeGoal && ( - <> -
-
+
+ {person?.laddersDetails?.map((details) => ( +
+ {details.activeGoal && ( +
+ + {details.pendingActions} +
- - {ladder.goalProgress}% + )} +
+ ))} +
+ {person?.laddersDetails?.map((details) => ( +
+ {details.lastActivityDate && ( + + {formatDate(details.lastActivityDate)} - - )} -
- ))} - -
- {person?.laddersDetails?.map((details) => ( -
- {details.activeGoal && ( -
- - {details.pendingActions} - + )}
- )} -
- ))} -
- {person?.laddersDetails?.map((details) => ( -
- {details.lastActivityDate && ( - - {formatDate(details.lastActivityDate)} - - )} -
- ))} -
+ ))} + {/* TODO: Create new component Dropdown Menu */} diff --git a/frontend/src/components/pages/People/People.hook.ts b/frontend/src/components/pages/People/People.hook.ts index f2c2ab73..4862a128 100644 --- a/frontend/src/components/pages/People/People.hook.ts +++ b/frontend/src/components/pages/People/People.hook.ts @@ -18,10 +18,10 @@ export const usePeople = () => { }, }); - const [tab, setTab] = useState