fix(ci): устранить ошибки eslint, блокировавшие CI
Refs EventHub/EventHubFrontAdmin#32 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -141,17 +141,3 @@ export function CommandPalette({ open, onOpenChange }: CommandPaletteProps) {
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Глобальный хоткей Ctrl/⌘+K */
|
|
||||||
export function useCommandPaletteHotkey(onOpen: () => void) {
|
|
||||||
useEffect(() => {
|
|
||||||
const handler = (e: KeyboardEvent) => {
|
|
||||||
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
|
|
||||||
e.preventDefault();
|
|
||||||
onOpen();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.addEventListener('keydown', handler);
|
|
||||||
return () => window.removeEventListener('keydown', handler);
|
|
||||||
}, [onOpen]);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ function Badge({ className, variant, ...props }: BadgeProps) {
|
|||||||
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { Badge, badgeVariants };
|
export { Badge };
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|||||||
);
|
);
|
||||||
Button.displayName = 'Button';
|
Button.displayName = 'Button';
|
||||||
|
|
||||||
export { Button, buttonVariants };
|
export { Button };
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
/** Глобальный хоткей Ctrl/⌘+K */
|
||||||
|
export function useCommandPaletteHotkey(onOpen: () => void) {
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = (e: KeyboardEvent) => {
|
||||||
|
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k') {
|
||||||
|
e.preventDefault();
|
||||||
|
onOpen();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener('keydown', handler);
|
||||||
|
return () => window.removeEventListener('keydown', handler);
|
||||||
|
}, [onOpen]);
|
||||||
|
}
|
||||||
@@ -49,7 +49,8 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
||||||
import { CommandPalette, useCommandPaletteHotkey } from '@/components/CommandPalette';
|
import { CommandPalette } from '@/components/CommandPalette';
|
||||||
|
import { useCommandPaletteHotkey } from '@/hooks/useCommandPaletteHotkey';
|
||||||
import { HeaderNodeMetrics } from '@/components/HeaderNodeMetrics';
|
import { HeaderNodeMetrics } from '@/components/HeaderNodeMetrics';
|
||||||
|
|
||||||
const navIconByKey: Record<string, React.ComponentType<{ className?: string }>> = {
|
const navIconByKey: Record<string, React.ComponentType<{ className?: string }>> = {
|
||||||
|
|||||||
@@ -161,10 +161,11 @@ const AdminListPage: React.FC = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const total = data?.total;
|
||||||
const exploreStats = useMemo(() => {
|
const exploreStats = useMemo(() => {
|
||||||
if (data?.total === undefined) return [];
|
if (total === undefined) return [];
|
||||||
return [{ label: t('common.total'), value: data.total }];
|
return [{ label: t('common.total'), value: total }];
|
||||||
}, [data?.total, t]);
|
}, [total, t]);
|
||||||
|
|
||||||
const columns = useMemo<ColumnDef<Admin>[]>(
|
const columns = useMemo<ColumnDef<Admin>[]>(
|
||||||
() => [
|
() => [
|
||||||
|
|||||||
Reference in New Issue
Block a user