diff --git a/src/components/app-shell.tsx b/src/components/app-shell.tsx index 5087d5e..a30ff9d 100644 --- a/src/components/app-shell.tsx +++ b/src/components/app-shell.tsx @@ -19,6 +19,7 @@ import { cn } from "@/lib/utils"; import type { ReactNode } from "react"; import { useBubbleCounts } from "@/lib/use-bubble-counts"; import { NotificationBell } from "@/components/notifications/notification-bell"; +import { DateCalculator } from "@/components/date-calculator"; function initials(name: string, email: string) { const src = (name || email || "").trim(); @@ -102,6 +103,7 @@ export function AppShell({ children }: { children: ReactNode }) {
Stage Law Firm, PLLC
Law Firm Suite
+ @@ -168,6 +170,7 @@ export function AppShell({ children }: { children: ReactNode }) { Counsel
+ + )} + + +
+
Date calculator
+
+ Add/subtract time or count days between dates. +
+
+ + + Add / subtract + Difference + + + +
+ + +
+
+
+ + +
+
+ + setAmount(e.target.value)} + className="h-9" + /> +
+
+ + +
+
+ {unit === "days" && ( + + )} +
+
Result
+
+ {result ? format(result, "EEEE, MMM d, yyyy") : "—"} +
+
+
+ + +
+ + +
+
+ + +
+ +
+
+ {diffBusinessOnly ? "Business days" : "Calendar days"} +
+
+ {diff} day{Math.abs(diff) === 1 ? "" : "s"} +
+
+
+
+
+ + ); +} + +function DatePopover({ value, onChange }: { value: Date; onChange: (d: Date) => void }) { + const [open, setOpen] = useState(false); + return ( + + + + + + { + if (d) { + onChange(d); + setOpen(false); + } + }} + initialFocus + className={cn("p-3 pointer-events-auto")} + /> + + + ); +}