Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.4 KB
Raw Blame
import { useUserId } from '@core/context/user';
import { fireAndForget } from '@core/util/fireAndForget';
import { Show } from 'solid-js';
import { NotificationSoundSection } from '../components/NotificationSoundSection';
import { QuietHoursSection } from '../components/QuietHoursSection';
import { playNotificationSound } from '../primitives/sound-player';
import { createNotificationSoundSettings } from '../primitives/sound-settings';

/** The Sounds section of the Notifications settings page. */
export function NotificationSoundSettingsView() {
  const userId = useUserId();
  return (
    <Show when={userId()} keyed>
      {(id) => {
        const sounds = createNotificationSoundSettings(id);
        return (
          <>
            <NotificationSoundSection
              settings={sounds.settings()}
              onEnabledChange={sounds.setEnabled}
              onVolumeChange={sounds.setVolume}
              onCategoryChange={sounds.setCategory}
              onPreview={(sound) =>
                fireAndForget(
                  playNotificationSound(sound, sounds.settings().volume),
                  'notification-sounds'
                )
              }
            />
            <QuietHoursSection
              quietHours={sounds.settings().quietHours}
              onChange={sounds.setQuietHours}
            />
          </>
        );
      }}
    </Show>
  );
}