diff --git a/web/src/components/settings/BuildDetails.tsx b/web/src/components/settings/BuildDetails.tsx index 6edcbe3..e0228c7 100644 --- a/web/src/components/settings/BuildDetails.tsx +++ b/web/src/components/settings/BuildDetails.tsx @@ -1,3 +1,5 @@ +import { match } from 'ts-pattern'; + import { useInstanceSettings, useInstanceVersion, @@ -12,22 +14,61 @@ export const BuildDetails = () => { 'https://github.com/v3xlabs/v3x-property/commit/' + instanceSettings.build_info.git_hash; + const isAlpha = instanceSettings?.build_info.version.includes('alpha'); + const update_available = instanceVersion?.update_available; + return (
- {instanceVersion?.update_available ? ( -
-
Update available
-
- You are running{' '} - {instanceVersion?.version}{' '} - but{' '} - {instanceVersion?.latest}{' '} - is available! -
-
- ) : ( -
You are on the latest
- )} + {match({ + update_available, + isAlpha, + }) + .with( + { + update_available: true, + isAlpha: false, + }, + () => ( +
+
Update available
+
+ You are running{' '} + + {instanceVersion?.version} + {' '} + but{' '} + + {instanceVersion?.latest} + {' '} + is available! +
+
+ ) + ) + .with( + { + isAlpha: true, + }, + () => ( +
+
You're running an alpha build
+
+ ) + ) + .with( + { + update_available: false, + isAlpha: false, + }, + () => ( +
+
You are on the latest
+
+ ) + ) + .otherwise(() => ( + <> + ))}