import { usePromise } from "@raycast/utils" import { fetchSettings } from "./api" import { Action, ActionPanel, Detail, Icon, List, openExtensionPreferences, } from "@raycast/api" import type { ComponentType } from "react" export function withSupermemory
(Component: ComponentType
) {
return function SupermemoryWrappedComponent(props: P) {
const { isLoading, data } = usePromise(fetchSettings, [], {
failureToastOptions: {
title: "Invalid API Key",
message:
"Invalid API key. Please check your API key in preferences. Get a new one from https://supermemory.link/raycast",
},
})
if (!data) {
return isLoading ? (
)
}
return