import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument, } from "@powerhousedao/reactor-browser";
import { assertIsVetraCloudEnvironmentDocument, isVetraCloudEnvironmentDocument, } from "./gen/document-schema.js";
/** Hook to get a VetraCloudEnvironment document by its id */
export function useVetraCloudEnvironmentDocumentById(documentId) {
    const [document, dispatch] = useDocumentById(documentId);
    if (!isVetraCloudEnvironmentDocument(document))
        return [undefined, undefined];
    return [document, dispatch];
}
/** Hook to get the selected VetraCloudEnvironment document */
export function useSelectedVetraCloudEnvironmentDocument() {
    const [document, dispatch] = useSelectedDocument();
    assertIsVetraCloudEnvironmentDocument(document);
    return [document, dispatch];
}
/** Hook to get all VetraCloudEnvironment documents in the selected drive */
export function useVetraCloudEnvironmentDocumentsInSelectedDrive() {
    const documentsInSelectedDrive = useDocumentsInSelectedDrive();
    return documentsInSelectedDrive?.filter(isVetraCloudEnvironmentDocument);
}
/** Hook to get all VetraCloudEnvironment documents in the selected folder */
export function useVetraCloudEnvironmentDocumentsInSelectedFolder() {
    const documentsInSelectedFolder = useDocumentsInSelectedFolder();
    return documentsInSelectedFolder?.filter(isVetraCloudEnvironmentDocument);
}
