Refactor channel and role selection in various forms to use Discord components
- Replaced standard input fields with DiscordChannelSelect and DiscordRoleSelect components in the BirthdaysForm, FeedsManager, GiveawaysManager, LevelingForm, LoggingForm, SchedulerManager, SelfRolesManager, StatsForm, SuggestionsConfigForm, TagsManager, TempVoiceForm, TicketConfigForm, and StarboardForm for improved user experience and consistency. - Updated state management to accommodate new component structures, enhancing data handling for channel and role selections across the application.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Suspense } from 'react';
|
||||
import { CommandsManager } from '@/components/modules/commands-manager';
|
||||
import { listGuildChannelsForDashboard, listGuildRolesForDashboard } from '@/lib/discord-guild-resources';
|
||||
import { listGuildChannelsForDashboard } from '@/lib/discord-guild-resources';
|
||||
import { getLocale, t } from '@/lib/i18n';
|
||||
import { getCommandGlobalRules } from '@/lib/module-configs/command-global-rules';
|
||||
import { listCommandOverridesDashboard } from '@/lib/module-configs/commands';
|
||||
@@ -11,12 +11,11 @@ interface CommandsPageProps {
|
||||
|
||||
export default async function CommandsPage({ params }: CommandsPageProps) {
|
||||
const { guildId } = await params;
|
||||
const [locale, commands, globalRules, channels, roles] = await Promise.all([
|
||||
const [locale, commands, globalRules, channels] = await Promise.all([
|
||||
getLocale(),
|
||||
listCommandOverridesDashboard(guildId),
|
||||
getCommandGlobalRules(guildId),
|
||||
listGuildChannelsForDashboard(guildId).catch(() => []),
|
||||
listGuildRolesForDashboard(guildId).catch(() => [])
|
||||
listGuildChannelsForDashboard(guildId).catch(() => [])
|
||||
]);
|
||||
|
||||
return (
|
||||
@@ -31,7 +30,6 @@ export default async function CommandsPage({ params }: CommandsPageProps) {
|
||||
initialCommands={commands}
|
||||
initialGlobalRules={globalRules}
|
||||
channels={channels}
|
||||
roles={roles}
|
||||
/>
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user