base commit

This commit is contained in:
@kirill.komarov
2026-05-03 19:57:12 +05:00
parent 9139a24093
commit fe10f25b8c
53 changed files with 2064 additions and 1071 deletions
+43
View File
@@ -0,0 +1,43 @@
import Button from '@mui/material/Button'
import Stack from '@mui/material/Stack'
type EntityRowActionsProps = {
onEdit?: () => void
onDelete?: () => void
deleteDisabled?: boolean
confirmDeleteMessage?: string
editLabel?: string
deleteLabel?: string
}
export function EntityRowActions({
onEdit,
onDelete,
deleteDisabled = false,
confirmDeleteMessage,
editLabel = 'Изменить',
deleteLabel = 'Удалить',
}: EntityRowActionsProps) {
return (
<Stack direction="row" spacing={0.5} sx={{ justifyContent: 'flex-end' }}>
{onEdit && (
<Button size="small" onClick={onEdit}>
{editLabel}
</Button>
)}
{onDelete && (
<Button
size="small"
color="error"
disabled={deleteDisabled}
onClick={() => {
if (confirmDeleteMessage && !confirm(confirmDeleteMessage)) return
onDelete()
}}
>
{deleteLabel}
</Button>
)}
</Stack>
)
}