This commit is contained in:
22
public/ts/components/modules/dynamicVoice.ts
Normal file
22
public/ts/components/modules/dynamicVoice.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { api } from '../../services/api.js';
|
||||
import { showToast } from '../../ui/toast.js';
|
||||
|
||||
export async function renderDynamicVoiceModule(guildId: string) {
|
||||
const container = document.getElementById('module-dynamicvoice');
|
||||
if (!container) return;
|
||||
container.innerHTML = '<p class="muted">Lade Dynamic Voice...</p>';
|
||||
try {
|
||||
const data: any = await api.dynamicVoice(guildId);
|
||||
const cfg = data?.config || data?.dynamicVoiceConfig || {};
|
||||
container.innerHTML = `
|
||||
<h3 class="label">Dynamic Voice</h3>
|
||||
<p class="muted">Lobby: ${cfg.lobbyChannelId || '-'}</p>
|
||||
<p class="muted">Template: ${cfg.template || '-'}</p>
|
||||
<p class="muted">User-Limit: ${cfg.userLimit ?? '-'}</p>
|
||||
`;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
container.innerHTML = '<div class="empty-state">Dynamic Voice konnte nicht geladen werden.</div>';
|
||||
showToast('Fehler beim Laden von Dynamic Voice', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user