fix: no default role, placeholder for role dropdown
This commit is contained in:
parent
cee5acab1d
commit
fd3f738b9f
|
|
@ -70,9 +70,16 @@ function RoleDropdown({ value, onChange }) {
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setOpen((v) => !v)}
|
onClick={() => setOpen((v) => !v)}
|
||||||
className="flex w-full h-[46px] items-center justify-between gap-2 rounded-2xl border border-[var(--color-border)] bg-[var(--color-surface-strong)] px-4 text-sm transition hover:border-[var(--color-accent)]"
|
className={[
|
||||||
|
'flex w-full h-[46px] items-center justify-between gap-2 rounded-2xl border px-4 text-sm transition hover:border-[var(--color-accent)]',
|
||||||
|
value ? 'border-[var(--color-border)] bg-[var(--color-surface-strong)]' : 'border-[var(--color-border)] bg-[var(--color-surface-strong)]',
|
||||||
|
].join(' ')}
|
||||||
>
|
>
|
||||||
<Badge tone={ROLE_TONES[value] || 'neutral'}>{ROLE_LABELS[value] || value}</Badge>
|
{value ? (
|
||||||
|
<Badge tone={ROLE_TONES[value] || 'neutral'}>{ROLE_LABELS[value]}</Badge>
|
||||||
|
) : (
|
||||||
|
<span className="text-[var(--color-text-muted)]">Выберите роль</span>
|
||||||
|
)}
|
||||||
<span className="text-[var(--color-text-muted)] text-xs">▾</span>
|
<span className="text-[var(--color-text-muted)] text-xs">▾</span>
|
||||||
</button>
|
</button>
|
||||||
{open && (
|
{open && (
|
||||||
|
|
@ -102,7 +109,7 @@ function RoleDropdown({ value, onChange }) {
|
||||||
|
|
||||||
/* ── Add-user modal ── */
|
/* ── Add-user modal ── */
|
||||||
function AddUserModal({ onSubmit, onClose, submitting, error }) {
|
function AddUserModal({ onSubmit, onClose, submitting, error }) {
|
||||||
const [form, setForm] = useState({ name: '', email: '', role: 'manager' });
|
const [form, setForm] = useState({ name: '', email: '', role: '' });
|
||||||
const nameRef = useRef(null);
|
const nameRef = useRef(null);
|
||||||
|
|
||||||
useEffect(() => { nameRef.current?.focus(); }, []);
|
useEffect(() => { nameRef.current?.focus(); }, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue