"use client"; import { useState } from "react"; import { AlertTriangle, CloudOff } from "lucide-react"; import { PendingQueueSheet } from "@/components/offline/pending-queue-sheet"; import { Button } from "@/components/ui/button"; import { useCurrentUserId } from "@/lib/auth/auth-context"; import { useHasRejectedHiveChange, usePendingHiveCount } from "./use-pending-hive"; export function pendingHiveText(count: number): string { return count === 1 ? "1 Änderung wartet auf Netz" : `${count} Änderungen warten auf Netz`; } export const REJECTED_HIVE_TEXT = "Eine Änderung an dieser Beute wurde abgelehnt. Neue Änderungen warten, bis du sie in der Warteschlange klärst."; /** * „1 Änderung wartet auf Netz“; with a refused change in the queue instead the * hint to resolve it there, with a button that opens the queue sheet. Nothing * while no change of the colony's hive waits. */ export function HivePendingNote({ colonyId, className }: { colonyId: string; className?: string }) { const count = usePendingHiveCount(colonyId); const rejected = useHasRejectedHiveChange(colonyId); const userId = useCurrentUserId(); const [sheetOpen, setSheetOpen] = useState(false); if (rejected && userId) { return (