lab 8 done
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user