import React, { useState } from 'react'; export default function CreateChannelModal({ onClose, onSave, defaultType = 'text' }) { const [name, setName] = useState(''); const [type, setType] = useState(defaultType); const handleSave = () => { const cleanName = name.trim().toLowerCase().replace(/[^a-z0-9-]/g, '-'); if (cleanName) onSave(cleanName, type); }; return (
e.stopPropagation()}>

Create Channel

{type === 'text' ? '#' : '🔊'} setName(e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, '-'))} placeholder="new-channel" className="w-full bg-panel text-text rounded p-2.5 pl-8 outline-none focus:ring-1 focus:ring-accent text-sm" autoFocus />
); }