'use client' import { useActionState, useState } from 'react' import { channelText } from '@/lib/i18n/chat' import { clearanceText, commonText } from '@/lib/i18n/common' import { createChannelAction, type ActionResult } from './actions' export function NewChannelForm({ levels }: { levels: { level: number; name: string }[] }) { const [offen, setOffen] = useState(false) const [state, action, pending] = useActionState( createChannelAction, null, ) if (!offen) { return ( ) } return (

{channelText.createTitle}

{channelText.keyHint}

{channelText.minClearanceHint} {clearanceText.label}

{state && !state.ok ? (

{state.error}

) : null}
) }