From 5378189162657c103449fb0b9ad097591fb0e05d Mon Sep 17 00:00:00 2001 From: Rebecca Gjerstad Date: Tue, 12 Dec 2023 12:44:09 +0100 Subject: [PATCH] Ryddet TeamName, mer lestbart --- .../src/components/common/TeamName.tsx | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/apps/frontend/src/components/common/TeamName.tsx b/apps/frontend/src/components/common/TeamName.tsx index e6d6701b4..3ea8be3ad 100644 --- a/apps/frontend/src/components/common/TeamName.tsx +++ b/apps/frontend/src/components/common/TeamName.tsx @@ -1,12 +1,26 @@ +import { BodyShort, Link } from '@navikt/ds-react' import { useTeam } from '../../api/TeamApi' import { teamKatTeamLink } from '../../util/config' -import { BodyShort, Detail, Link } from '@navikt/ds-react' -export const TeamName = (props: { id: string; link?: boolean; big?: boolean }) => { - const [name] = useTeam()(props.id) +interface IPropsTeamName { + id: string + link?: boolean + big?: boolean +} + +interface IPropsTeams { + teams: string[] + link?: boolean + list?: boolean + big?: boolean +} + +export const TeamName = (props: IPropsTeamName) => { + const { id, link, big } = props + const [name] = useTeam()(id) - return props.link ? ( - + return link ? ( + {name} (åpnes i ny fane) ) : ( @@ -14,11 +28,15 @@ export const TeamName = (props: { id: string; link?: boolean; big?: boolean }) = ) } -export const Teams = (props: { teams: string[]; link?: boolean; list?: boolean; big?: boolean }) => ( -
- Team: - {props.teams.map((t, idx) => ( - - ))} -
-) +export const Teams = (props: IPropsTeams) => { + const { teams, link, big } = props + + return ( +
+ Team: + {teams.map((team, index) => ( + + ))} +
+ ) +}