diff options
Diffstat (limited to 'frontend/app')
| -rw-r--r-- | frontend/app/components/ExecStatusIndicatorIcon.tsx | 45 | ||||
| -rw-r--r-- | frontend/app/components/GolfWatchApps/GolfWatchAppGaming.tsx | 8 | ||||
| -rw-r--r-- | frontend/app/routes/_index.tsx | 4 |
3 files changed, 55 insertions, 2 deletions
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 ( + <FontAwesomeIcon + icon={faRotate} + spin + fixedWidth + className="text-gray-700" + /> + ); + case "success": + return ( + <FontAwesomeIcon + icon={faCircleCheck} + fixedWidth + className="text-green-500" + /> + ); + case "canceled": + return ( + <FontAwesomeIcon icon={faBan} fixedWidth className="text-gray-400" /> + ); + default: + return ( + <FontAwesomeIcon + icon={faCircleExclamation} + fixedWidth + className="text-red-500" + /> + ); + } +} 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({ <li key={idx}> <div> <div> - {result.status} {result.label} + <ExecStatusIndicatorIcon status={result.status} />{" "} + {result.label} </div> <div> {result.stdout} @@ -160,7 +163,8 @@ export default function GolfWatchAppGaming({ <li key={idx}> <div> <div> - {result.status} {result.label} + <ExecStatusIndicatorIcon status={result.status} />{" "} + {result.label} </div> <div> {result.stdout} diff --git a/frontend/app/routes/_index.tsx b/frontend/app/routes/_index.tsx index 2fcf1f2..25b9c81 100644 --- a/frontend/app/routes/_index.tsx +++ b/frontend/app/routes/_index.tsx @@ -1,7 +1,11 @@ +import { config } from "@fortawesome/fontawesome-svg-core"; import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { Link } from "@remix-run/react"; +import "@fortawesome/fontawesome-svg-core/styles.css"; import { ensureUserNotLoggedIn } from "../.server/auth"; +config.autoAddCss = false; + export const meta: MetaFunction = () => [ { title: "iOSDC Japan 2024 Albatross.swift" }, ]; |
