diff --git a/app/routes/_app+/recipients+/_layout.tsx b/app/routes/_app+/recipients+/_layout.tsx index a90f6efe..2a0e7b08 100644 --- a/app/routes/_app+/recipients+/_layout.tsx +++ b/app/routes/_app+/recipients+/_layout.tsx @@ -1,14 +1,7 @@ import { json, type LoaderFunctionArgs } from '@remix-run/node' import { Link, NavLink, Outlet, useLoaderData } from '@remix-run/react' -import { useState } from 'react' import { GeneralErrorBoundary } from '#app/components/error-boundary.tsx' import { ButtonLink } from '#app/components/ui/button.tsx' -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from '#app/components/ui/dropdown-menu.tsx' import { Icon } from '#app/components/ui/icon.tsx' import { SimpleTooltip } from '#app/components/ui/tooltip.js' import { requireUserId } from '#app/utils/auth.server.js' @@ -70,7 +63,6 @@ export async function loader({ request }: LoaderFunctionArgs) { export default function RecipientsLayout() { const { recipients } = useLoaderData() - const [isOpen, setIsOpen] = useState(false) return (
@@ -93,73 +85,79 @@ export default function RecipientsLayout() {
- - - Select recipient - - - {recipients.map((recipient) => ( - - setIsOpen(false)} - className={cn( - 'flex w-full items-center gap-2 overflow-x-auto rounded-sm px-2 py-1.5 text-xl transition-colors', - 'hover:bg-accent hover:text-accent-foreground', - 'focus:bg-accent focus:text-accent-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', - )} - > - {({ isActive }) => ( -
- - {recipient.name} - {recipient.disabled ? ( - - - - ) : recipient.cronError ? ( - - - - ) : recipient._count.messages > 0 ? null : ( - - - - )} -
- )} -
-
- ))} - {recipients.length === 0 && ( -
- No recipients found. Add one to get started. +
+ + + + Select a recipient + + {recipients.length} total + + + +
+ {recipients.length === 0 ? ( +
+ No recipients found.{' '} + + Add one to get started. +
+ ) : ( +
    + {recipients.map((recipient) => ( +
  • + + cn( + 'flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm font-medium transition-colors', + 'hover:bg-accent/40 hover:text-accent-foreground', + 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring', + isActive + ? 'border-transparent bg-accent text-accent-foreground' + : 'border-border/70 text-foreground', + ) + } + > + {recipient.name} + + {recipient.disabled ? ( + + + + ) : recipient.cronError ? ( + + + + ) : recipient._count.messages > 0 ? null : ( + + + + )} + + +
  • + ))} +
)} - - +
+