import { useHomeowner } from "@/contexts/HomeownerContext";
import DocumentsPage from "@/pages/DocumentsPage";

export default function HomeownerDocumentsPage() {
  const { association, loading } = useHomeowner();

  if (loading) {
    return (
      <div className="flex items-center justify-center py-20">
        <div className="h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" />
      </div>
    );
  }

  if (!association?.id) {
    return (
      <div className="flex items-center justify-center py-20 text-muted-foreground">
        No association found for your account.
      </div>
    );
  }

  return (
    <DocumentsPage
      boardAssociationIds={[association.id]}
      viewerRole="homeowner"
    />
  );
}
