Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/components/common/Team/Team.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import styled from "styled-components";
import get from "lodash/get";
import toLower from "lodash/toLower";
import { match } from "ts-pattern";
import { faCrown } from "@fortawesome/free-solid-svg-icons";
import { faGitlab } from "@fortawesome/free-brands-svg-icons";
import { P5, Icon, Stack } from "@deskpro/deskpro-ui";
import { icons } from "./icons";
import type { FC } from "react";
import type { AnyIcon } from "@deskpro/deskpro-ui";
import type { Issue } from "../../../services/linear/types";
Expand Down Expand Up @@ -31,10 +30,7 @@ const Team: FC<Props> = ({ team }) => {
);
}

const teamIcon = match(toLower(icon))
.with("crown", () => faCrown)
.with("gitlab", () => faGitlab)
.otherwise(() => undefined);
const teamIcon = get(icons, toLower(icon));

return (
<Stack align="center" gap={6} >
Expand Down
37 changes: 37 additions & 0 deletions src/components/common/Team/icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {
faCrown,
faUserGroup,
faSatelliteDish,
faGamepad,
faBatteryFull,
faVolumeOff,
faDatabase,
faTerminal,
faClock,
faStopwatch,
faUnlockKeyhole,
faCompass,
faServer,
} from "@fortawesome/free-solid-svg-icons";
import { faGitlab } from "@fortawesome/free-brands-svg-icons";

const icons = {
crown: faCrown,
gitlab: faGitlab,
team: faUserGroup,
radar: faSatelliteDish,
chip: undefined,
joystick: faGamepad,
battery: faBatteryFull,
sound: faVolumeOff,
cone: undefined,
database: faDatabase,
terminal: faTerminal,
watch: faClock,
clock: faStopwatch,
lock: faUnlockKeyhole,
compass: faCompass,
server: faServer,
};

export { icons };