Function
SortableTab
({
index,
tab,
selected,
onSelectChange,
onClose,
}: SortableTabProps)
Source from the content-addressed store, hash-verified
| 76 | }); |
| 77 | |
| 78 | export function SortableTab({ |
| 79 | index, |
| 80 | tab, |
| 81 | selected, |
| 82 | onSelectChange, |
| 83 | onClose, |
| 84 | }: SortableTabProps) { |
| 85 | const { |
| 86 | attributes, |
| 87 | listeners, |
| 88 | transition, |
| 89 | transform, |
| 90 | isDragging, |
| 91 | setNodeRef, |
| 92 | } = useSortable({ id: tab.key }); |
| 93 | |
| 94 | const style = { |
| 95 | transform: CSS.Translate.toString(transform), |
| 96 | transition, |
| 97 | }; |
| 98 | |
| 99 | return ( |
| 100 | <WindowTabItemButton |
| 101 | ref={setNodeRef} |
| 102 | icon={tab.icon} |
| 103 | title={tab.title} |
| 104 | onClick={onSelectChange} |
| 105 | selected={selected} |
| 106 | onClose={onClose} |
| 107 | style={style} |
| 108 | index={index} |
| 109 | isDragging={isDragging} |
| 110 | {...attributes} |
| 111 | {...listeners} |
| 112 | /> |
| 113 | ); |
| 114 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected