Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

1.2 KB
Raw Blame
import { BellOffIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsEmpty } from "@/components/settings/settings-empty";
import useGetNotificationPreferences from "@/hooks/queries/notification-preferences/use-get-notification-preferences";
import { ChannelsSection } from "./channels/channels-section";
import { NotifyMeSection } from "./events/notify-me-section";
import { NotificationSettingsSkeleton } from "./notification-settings-skeleton";
import { WorkspacesSection } from "./workspaces/workspaces-section";

export function NotificationSettings() {
  const { t } = useTranslation();
  const { data: preferences, isLoading } = useGetNotificationPreferences();

  if (isLoading) return <NotificationSettingsSkeleton />;

  if (!preferences) {
    return (
      <SettingsCard>
        <SettingsEmpty
          icon={<BellOffIcon />}
          title={t("settings:notificationsPage.loadFailed")}
        />
      </SettingsCard>
    );
  }

  return (
    <>
      <NotifyMeSection preferences={preferences} />
      <ChannelsSection preferences={preferences} />
      <WorkspacesSection preferences={preferences} />
    </>
  );
}