import { useReadAllNotifications } from "@/features/notifications";
import { NotificationsList } from "@/features/notifications/ui/NotificationsList";
import { PageContainer } from "@/shared/ui/PageContainer";
import { SearchBar } from "@/shared/ui/SearchBar";
import { Button } from "@/shared/ui/button";
import { Loader2 } from "lucide-react";

const SEARCH_PARAM_NAME = "search";

export const NotificationsPage: React.FC = () => {
  const { mutate: readAll, isPending } = useReadAllNotifications();

  return (
    <PageContainer name="Notifications" hasBackIcon={false}>
      <div className="flex flex-col gap-4">
        <div className="flex items-center justify-between gap-2 px-3">
          <SearchBar
            paramName={SEARCH_PARAM_NAME}
            placeholder="Search notifications by title or body..."
            className="flex-1"
          />
          <Button
            onClick={() => readAll()}
            disabled={isPending}
            filling="outline"
            size="sm"
            className="whitespace-nowrap"
          >
            {isPending ? (
              <Loader2 className="h-4 w-4 animate-spin mr-2" />
            ) : null}
            Read All
          </Button>
        </div>
        <NotificationsList searchParamName={SEARCH_PARAM_NAME} />
      </div>
    </PageContainer>
  );
};

Homonyms

cyberia/research/events/client/src/pages/txhash/index.tsx
cyberia/research/events/client/src/pages/place/index.tsx
cyberia/research/events/client/src/pages/user/index.tsx
cyberia/research/events/client/src/pages/purchase/index.tsx
cyberia/research/events/client/src/pages/account/index.tsx
cyberia/research/events/client/src/pages/manage/index.tsx
cyberia/research/events/client/src/pages/shaman-verification/index.tsx
cyberia/research/events/client/src/pages/404/index.tsx
cyberia/research/events/client/src/pages/map/index.tsx
cyberia/research/events/client/src/pages/events/index.tsx
cyberia/research/events/client/src/pages/socials/index.tsx
cyberia/research/events/client/src/pages/home/index.tsx
cyberia/research/events/client/src/pages/events/attendees/index.tsx
cyberia/research/events/client/src/pages/events/create/index.tsx
cyberia/research/events/client/src/pages/events/details/index.tsx
cyberia/research/events/client/src/pages/manage/verifiedshamans/index.tsx
cyberia/research/events/client/src/pages/manage/staff/index.tsx
cyberia/research/events/client/src/pages/manage/verification-stats/index.tsx
cyberia/research/events/client/src/pages/manage/place/index.tsx
cyberia/research/events/client/src/pages/events/edit/index.tsx
cyberia/research/events/client/src/pages/manage/localprovider/index.tsx
cyberia/research/events/client/src/pages/manage/place/update/index.tsx
cyberia/research/events/client/src/pages/manage/place/create/index.tsx
cyberia/research/events/client/src/pages/account/distribution-profiles/create/index.tsx
cyberia/research/events/client/src/pages/manage/place/request/index.tsx

Graph