improve dashboard usability and fix backend TS build errors
Frontend: fix HeroUI Switch usage across the whole app (Content/Control/ Thumb composition was missing, so no toggle ever rendered visibly), replace raw channel/role ID text fields with proper name-based dropdowns (ChannelSelect/RoleSelect) backed by the existing /guild/resources endpoint, redesign Automod's filters as inline toggle rows, turn the Ticket Pipeline tab into a drag-and-drop Kanban board, narrow the sidebar further and rework its collapse toggle and profile footer, and add a Discord-style message preview for Welcome/Support Login. Backend: fix the ~50 TypeScript build errors blocking `npm run build` (SlashCommandBuilder typing, discord.js v14 channel-union guards, Prisma JSON null handling, logger.warn signature, and related type narrowing) so the project compiles cleanly again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
32
frontend/src/components/shared/AppSwitch.tsx
Normal file
32
frontend/src/components/shared/AppSwitch.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Switch } from '@heroui/react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
type Props = {
|
||||
isSelected: boolean;
|
||||
onChange: (value: boolean) => void;
|
||||
label?: ReactNode;
|
||||
description?: ReactNode;
|
||||
isDisabled?: boolean;
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
'aria-label'?: string;
|
||||
};
|
||||
|
||||
export function AppSwitch({ isSelected, onChange, label, description, isDisabled, size, ...rest }: Props) {
|
||||
return (
|
||||
<Switch
|
||||
isSelected={isSelected}
|
||||
onChange={onChange}
|
||||
isDisabled={isDisabled}
|
||||
size={size}
|
||||
aria-label={!label ? rest['aria-label'] || 'Umschalten' : undefined}
|
||||
>
|
||||
<Switch.Content>
|
||||
<Switch.Control>
|
||||
<Switch.Thumb />
|
||||
</Switch.Control>
|
||||
{label && <span>{label}</span>}
|
||||
</Switch.Content>
|
||||
{description && <p data-slot="description" className="text-xs text-muted">{description}</p>}
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user