@vention/machine-apps-components 1.31.10 → 1.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -811,6 +811,36 @@ import { LogsPagination } from "@vention/machine-apps-components"
811
811
  ;<LogsPagination currentPage={currentPage} totalPages={totalPages} onPageChange={page => setCurrentPage(page)} />
812
812
  ```
813
813
 
814
+ ### Layout and page states
815
+
816
+ `FlexContainer`, `LoadState`, `PageLoading` and `PageLoadError`. They're also exported from
817
+ `@vention/machine-apps-components/layout`, which doesn't run the root entry's i18n setup. Apps with their own
818
+ i18next instance import them from there.
819
+
820
+ ```tsx
821
+ import { LoadState, PageLoadError } from "@vention/machine-apps-components/layout"
822
+
823
+ <LoadState
824
+ isLoading={isLoading}
825
+ isError={isError}
826
+ setupError={setupError}
827
+ onRetry={refetch}
828
+ isEmpty={devices.length === 0}
829
+ errorText={t("devices.loadFailed")}
830
+ emptyText={t("devices.empty")}
831
+ retryText={t("retry")}
832
+ >
833
+ <DeviceList devices={devices} />
834
+ </LoadState>
835
+
836
+ <PageLoadError message={t("device.loadFailed")} actionText={t("goBack")} onAction={() => navigate("/")} />
837
+ ```
838
+
839
+ - `LoadState`: a spinner while loading, `errorText` with the backend's `setupError` or a retry button, `emptyText`
840
+ when empty, otherwise its children.
841
+ - `PageLoading`: a centered spinner that fills the page.
842
+ - `PageLoadError`: a full-page message with one action.
843
+
814
844
  ## Development
815
845
 
816
846
  ### Running Tests