feat(app): editor Général, Références and Vertèbres tabs, delete with dependents
This commit is contained in:
1 parent
6aba9711f0
commit
d163b2ce9a
24 files changed
+2239
-12
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import { useT } from '@/i18n/useT'
|
||||
import ActionButton from './ActionButton'
|
||||
|
||||
/** ↑ / ↓ for a list row: one `move` per press; absent while read-only. */
|
||||
export default function MoveButtons({
|
||||
index,
|
||||
count,
|
||||
readOnly,
|
||||
onMove,
|
||||
}: {
|
||||
index: number
|
||||
count: number
|
||||
readOnly: boolean
|
||||
onMove: (position: number) => void
|
||||
}) {
|
||||
const t = useT()
|
||||
return (
|
||||
<>
|
||||
<ActionButton
|
||||
readOnly={readOnly}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
aria-label={t('editor.action.move_up')}
|
||||
disabled={index === 0}
|
||||
onClick={() => onMove(index - 1)}
|
||||
>
|
||||
↑
|
||||
</ActionButton>
|
||||
<ActionButton
|
||||
readOnly={readOnly}
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
aria-label={t('editor.action.move_down')}
|
||||
disabled={index >= count - 1}
|
||||
onClick={() => onMove(index + 1)}
|
||||
>
|
||||
↓
|
||||
</ActionButton>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user