lab 8 done

This commit is contained in:
2026-04-24 12:16:17 +10:00
parent 7684b8d705
commit c37b24ec38
8 changed files with 118 additions and 14 deletions

View File

@@ -6,9 +6,10 @@ import DragIndicatorIcon from '@mui/icons-material/DragIndicator';
interface SortableItemProps {
item: string;
id: string;// чтобы тайпскрипт компилятор не жаловался, добавил в инетрфейс, хотя и так компилируется нормально
isDisabled:boolean;
}
export function SortableItem({ item }: SortableItemProps) {
export function SortableItem({ item ,isDisabled}: SortableItemProps) {
const id = item; /* идентификатор для useSortable */
const {
attributes,
@@ -24,7 +25,7 @@ export function SortableItem({ item }: SortableItemProps) {
};
return (
<ListItem ref={ setNodeRef } style={ style } { ...attributes } { ...listeners }>
<ListItem ref={ isDisabled ? undefined : setNodeRef } style={ style } { ...attributes } { ...listeners }>
<ListItemButton
sx={{
border: '1px solid gray',