import { lazy, Suspense } from "react";
import type { PersonalResourceAttachmentController } from "../lib/use-personal-resource-attachment";
import { FailureRecoveryBoundary } from "./session/failure-recovery-boundary";
const LazyControl = lazy(() =>
import("./personal-resource-attachment-control").then((module) => ({
default: module.PersonalResourceAttachmentControl,
})),
);
export function PersonalResourceAttachmentSurface(props: {
controller: PersonalResourceAttachmentController;
disabled?: boolean | undefined;
compact?: boolean | undefined;
}) {
const { controller } = props;
if (
!controller.eligible ||
!(controller.error || controller.notice || controller.loading || controller.truncated)
)
return null;
const blocked = controller.error
? " The selected resource is unavailable; sending remains blocked."
: null;
return (