import { format } from "date-fns"
import { AlertTriangle, Clock } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Card, CardContent } from "@/components/ui/card"
import { MoodBadge } from "@/components/mood/mood-badge"
import {
useDiscardQueued,
useQueuedEntries,
useRetryQueued,
} from "@/hooks/use-outbox"
import { isStuck } from "@/lib/outbox-sync"
import { contentPreview } from "@/lib/entry-preview"
import type { QueuedEntry } from "@/lib/store/outbox"
/**
* Entries written on this device that the server has not taken yet. They are
* shown with the journal so that logging offline still looks like it worked.
*/
export function PendingEntries() {
const { data: queued = [] } = useQueuedEntries()
if (!queued.length) return null
return (