From 04ff82d35e9cbd3d2a86204260f58a370fda88da Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 10 Aug 2024 21:58:13 +0900 Subject: feat(frontend): show status indicator icon --- .../app/components/ExecStatusIndicatorIcon.tsx | 45 ++++++++++++++++++++++ .../GolfWatchApps/GolfWatchAppGaming.tsx | 8 +++- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 frontend/app/components/ExecStatusIndicatorIcon.tsx (limited to 'frontend/app/components') diff --git a/frontend/app/components/ExecStatusIndicatorIcon.tsx b/frontend/app/components/ExecStatusIndicatorIcon.tsx new file mode 100644 index 0000000..a76e957 --- /dev/null +++ b/frontend/app/components/ExecStatusIndicatorIcon.tsx @@ -0,0 +1,45 @@ +import { + faBan, + faCircleCheck, + faCircleExclamation, + faRotate, +} from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; + +type Props = { + status: string; +}; + +export default function ExecStatusIndicatorIcon({ status }: Props) { + switch (status) { + case "running": + return ( + + ); + case "success": + return ( + + ); + case "canceled": + return ( + + ); + default: + return ( + + ); + } +} diff --git a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx index 992ce7a..53d5bce 100644 --- a/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx +++ b/frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx @@ -1,3 +1,5 @@ +import ExecStatusIndicatorIcon from "../ExecStatusIndicatorIcon"; + type Props = { problem: string; playerInfoA: PlayerInfo; @@ -128,7 +130,8 @@ export default function GolfWatchAppGaming({
  • - {result.status} {result.label} + {" "} + {result.label}
    {result.stdout} @@ -160,7 +163,8 @@ export default function GolfWatchAppGaming({
  • - {result.status} {result.label} + {" "} + {result.label}
    {result.stdout} -- cgit v1.2.3-70-g09d2