From ca0d5f0ec1f4ba21f4bf51f0f773d2b6bad45c93 Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Thu, 17 Jul 2025 08:49:12 -0400 Subject: reorganize for readability and DRY (#115) * reorganize for readability and DRY * rm backup files * ver bump --- src/components/ResultDisplay.tsx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/components/ResultDisplay.tsx (limited to 'src/components/ResultDisplay.tsx') diff --git a/src/components/ResultDisplay.tsx b/src/components/ResultDisplay.tsx new file mode 100644 index 0000000..0f58f0e --- /dev/null +++ b/src/components/ResultDisplay.tsx @@ -0,0 +1,37 @@ +import { PanelSectionRow } from "@decky/ui"; +import { FC } from "react"; +import { STYLES } from "../utils/constants"; +import { ApiResponse } from "../types/index"; + +export type OperationResult = ApiResponse; + +interface ResultDisplayProps { + result: OperationResult | null; +} + +export const ResultDisplay: FC = ({ result }) => { + if (!result) return null; + + return ( + +
+ Status:{" "} + + {result.status === "success" ? "Success" : "Error"} + +
+ {result.output ? ( + <> + Output: +
{result.output}
+ + ) : null} + {result.message ? ( + <> + Error: {result.message} + + ) : null} +
+
+ ); +}; -- cgit v1.2.3