'use client' import { useActionState } from 'react' import { notifyText } from '@/lib/i18n/shell' import { saveNotifyModeAction, type ActionResult } from './actions' const MODES = ['ALL', 'OWN_CASES', 'MENTIONS', 'OFF'] as const export function NotifyForm({ current }: { current: string }) { const [state, action, pending] = useActionState( saveNotifyModeAction, null, ) return (
{notifyText.mode}
{MODES.map((mode) => ( ))}
{state?.ok ? ( {notifyText.saved} ) : null} {state && !state.ok ? ( {state.error} ) : null}
) }