-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Compensations): display yearly bonuses for selected location
- Loading branch information
Showing
5 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/compensations/components/yearlyBonuses/YearlyBonuses.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { BonusPage } from "studio/lib/payloads/compensations"; | ||
import Text from "../../../components/text/Text"; | ||
import styles from "./yearlyBonuses.module.css"; | ||
|
||
interface YearlyBonusesProps { | ||
bonuses: BonusPage[]; | ||
} | ||
|
||
const YearlyBonuses = ({ bonuses }: YearlyBonusesProps) => { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<Text type={"h3"}>Historisk bonus</Text> | ||
<table className={styles.table}> | ||
<thead> | ||
<tr> | ||
<th> | ||
<Text>År</Text> | ||
</th> | ||
<th className={styles.bonusHeader}> | ||
<Text>Beløp</Text> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{bonuses | ||
.sort((a, b) => b.year - a.year) | ||
.map((bonus) => ( | ||
<tr key={bonus._key}> | ||
<th> | ||
<Text type={"small"}>{bonus.year}</Text> | ||
</th> | ||
<td className={styles.bonusCell}> | ||
<Text type={"small"}>{bonus.bonus}</Text> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
); | ||
}; | ||
|
||
export default YearlyBonuses; |
15 changes: 15 additions & 0 deletions
15
src/compensations/components/yearlyBonuses/yearlyBonuses.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.table { | ||
text-align: left; | ||
max-width: 500px; | ||
} | ||
|
||
.bonusHeader, | ||
.bonusCell { | ||
text-align: right; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters