"use client"; import { useAtom } from "jotai"; import { type FC, useCallback, useId } from "react"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { type NotificationSoundType, notificationSettingsAtom, } from "@/lib/atoms/notifications"; import { getAvailableSoundTypes, getSoundDisplayName, playNotificationSound, } from "@/lib/notifications"; interface NotificationSettingsProps { showLabels?: boolean; showDescriptions?: boolean; className?: string; } export const NotificationSettings: FC = ({ showLabels = true, showDescriptions = true, className = "", }: NotificationSettingsProps) => { const selectId = useId(); const [settings, setSettings] = useAtom(notificationSettingsAtom); const handleSoundTypeChange = useCallback( (value: NotificationSoundType) => { setSettings((prev) => ({ ...prev, soundType: value, })); }, [setSettings], ); const handleTestSound = useCallback(() => { if (settings.soundType !== "none") { playNotificationSound(settings.soundType); } }, [settings.soundType]); const availableSoundTypes = getAvailableSoundTypes(); return (
{showLabels && ( )}
{settings.soundType !== "none" && ( )}
{showDescriptions && (

Claude Code のタスクが完了した時に再生する音を選択してください

)}
); };