Fix Next.js 15 compatibility and TypeScript errors
- Update API route handlers to use async params for Next.js 15 compatibility - Fix MUI DataGrid deprecated props (pageSize -> initialState.pagination) - Replace Material-UI Grid components with Box for better compatibility - Fix admin authentication system with proper request parameters - Update permission constants to match available AdminPermission enum values - Add missing properties to Page interface for type safety - Update .gitignore to exclude venv/, import logs, and large data directories - Optimize Next.js config to reduce memory usage during builds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -231,16 +231,16 @@ export function ImageUpload({ open, onClose, onImageSelect }: ImageUploadProps)
|
||||
{loadingMedia ? (
|
||||
<Typography>Loading media files...</Typography>
|
||||
) : (
|
||||
<Grid container spacing={2}>
|
||||
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 2 }}>
|
||||
{mediaFiles.length === 0 ? (
|
||||
<Grid item xs={12}>
|
||||
<Typography color="text.secondary" textAlign="center">
|
||||
<Box sx={{ width: '100%', textAlign: 'center' }}>
|
||||
<Typography color="text.secondary">
|
||||
No images found. Upload some images first.
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Box>
|
||||
) : (
|
||||
mediaFiles.map((file) => (
|
||||
<Grid item xs={12} sm={6} md={4} key={file.id}>
|
||||
<Box key={file.id} sx={{ width: { xs: '100%', sm: '48%', md: '31%' } }}>
|
||||
<Card>
|
||||
<CardMedia
|
||||
component="img"
|
||||
@@ -267,10 +267,10 @@ export function ImageUpload({ open, onClose, onImageSelect }: ImageUploadProps)
|
||||
</Button>
|
||||
</CardActions>
|
||||
</Card>
|
||||
</Grid>
|
||||
</Box>
|
||||
))
|
||||
)}
|
||||
</Grid>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user