* feat: sound on notification * refactor: add load audio * chore: remove * fix: type error * fix: notification * fix: prevent multiple initialization = * feat: create notification page * chore: update the mp3 file
21 lines
702 B
TypeScript
21 lines
702 B
TypeScript
"use client";
|
|
|
|
import { useWebPush } from "@calcom/features/notifications/WebPushContext";
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { Button } from "@calcom/ui";
|
|
|
|
const PushNotificationsView = () => {
|
|
const { t } = useLocale();
|
|
const { subscribe, unsubscribe, isSubscribed, isLoading } = useWebPush();
|
|
|
|
return (
|
|
<div className="border-subtle rounded-b-xl border-x border-b px-4 pb-10 pt-8 sm:px-6">
|
|
<Button color="primary" onClick={isSubscribed ? unsubscribe : subscribe} disabled={isLoading}>
|
|
{isSubscribed ? t("disable_browser_notifications") : t("allow_browser_notifications")}
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default PushNotificationsView;
|