Enhance EntryTraceDialog component by refactoring data display logic into dedicated summary functions for improved readability and maintainability. Update GridTab to streamline checkbox state management with a new toggle function. Refactor RulesCard to simplify window removal logic. Adjust CollectionsPanel, GenresPanel, GroupsPanel, RolesPanel, ShowsPanel, and UsersPanel to import sorting utilities from a centralized location, enhancing code organization. Update ThemeProvider to utilize a shared theme context for better consistency across the application.
This commit is contained in:
@@ -51,6 +51,8 @@ export function BlockBuilder({
|
||||
setItems((current) => [...current, item])
|
||||
}
|
||||
|
||||
const removeAt = (index: number) => setItems((current) => current.filter((_, i) => i !== index))
|
||||
|
||||
/** Перестановка внутри черновика — до сохранения всё живёт в состоянии, запросов нет. */
|
||||
const reorder = (target: number) => {
|
||||
if (dragged === null || dragged === target) return
|
||||
@@ -110,7 +112,7 @@ export function BlockBuilder({
|
||||
<Button
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => setItems((c) => c.filter((_, i) => i !== index))}
|
||||
onClick={() => removeAt(index)}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user