integrate LinkedItems
into /route
pages
This commit is contained in:
@ -104,7 +104,7 @@ export const LinkedItems = <T extends {id: number; [key: string]: any}>({parentI
|
||||
|
||||
<AccordionDetails sx={{background: theme.palette.background.paper}}>
|
||||
<Stack gap={2}>
|
||||
<Grid container gap={2}>
|
||||
<Grid container gap={1.25}>
|
||||
{isLoading ? (
|
||||
<Typography>Загрузка...</Typography>
|
||||
) : linkedItems.length > 0 ? (
|
||||
@ -112,20 +112,20 @@ export const LinkedItems = <T extends {id: number; [key: string]: any}>({parentI
|
||||
<Box
|
||||
key={index}
|
||||
sx={{
|
||||
marginBottom: '8px',
|
||||
marginTop: '8px',
|
||||
padding: '14px',
|
||||
borderRadius: 2,
|
||||
border: `2px solid ${theme.palette.divider}`,
|
||||
}}
|
||||
>
|
||||
<Stack gap={0.5}>
|
||||
<Stack gap={0.25}>
|
||||
{fields.map(({label, data}) => (
|
||||
<Typography key={String(data)}>
|
||||
<Typography variant="body2" color="textSecondary" key={String(data)}>
|
||||
<strong>{label}:</strong> {item[data]}
|
||||
</Typography>
|
||||
))}
|
||||
{type === 'edit' && (
|
||||
<Button variant="outlined" color="error" onClick={() => deleteItem(item.id)} sx={{mt: 1.5}}>
|
||||
<Button variant="outlined" color="error" size="small" onClick={() => deleteItem(item.id)} sx={{mt: 1.5}}>
|
||||
Отвязать
|
||||
</Button>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user