- Unify API: lib/api.ts uses /api/v1, inbox uses /api/inbox (rewrites) - Remove localhost refs: openapi, inbox page - Add rewrites: /api/inbox|tmc -> inbox-server, /api/v1 -> FastAPI - Add stub routes: knowledge/insights, recommendations, search, log-error - Transfer from PAPA: prompts (inspection, tmc), scripts, supabase, data/tmc-requests - Fix inbox-server: ORDER BY created_at, package.json - Remove redundant app/api/inbox/files route (rewrites handle it) - knowledge/ in gitignore (large PDFs) Co-authored-by: Cursor <cursoragent@cursor.com>
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
/**
|
||
* Доступное изображение с обязательным alt текстом
|
||
*/
|
||
'use client';
|
||
|
||
import { ImgHTMLAttributes } from 'react';
|
||
import Image from 'next/image';
|
||
|
||
interface AccessibleImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'alt'> {
|
||
src: string;
|
||
alt: string; // Обязательный alt текст
|
||
width?: number;
|
||
height?: number;
|
||
priority?: boolean;
|
||
}
|
||
|
||
export default function AccessibleImage({
|
||
src,
|
||
alt,
|
||
width,
|
||
height,
|
||
priority = false,
|
||
...props
|
||
}: AccessibleImageProps) {
|
||
// Проверка, что alt текст предоставлен
|
||
if (!alt || alt.trim() === '') {
|
||
console.warn('AccessibleImage: alt text is required for accessibility');
|
||
}
|
||
|
||
// Если это декоративное изображение, используем пустой alt
|
||
const altText = alt === 'decorative' ? '' : alt;
|
||
|
||
return (
|
||
<Image
|
||
src={src}
|
||
alt={altText}
|
||
width={width}
|
||
height={height}
|
||
priority={priority}
|
||
{...props}
|
||
style={{
|
||
...props.style,
|
||
}}
|
||
/>
|
||
);
|
||
}
|