Files
request-portal/src/webparts/requestPortal/components/RequestGrid/RequestGrid.tsx
T
Тимур Городецкий c98a665611
Tests / frontend-test (push) Successful in 4m11s
refactor: миграция форм на ui-kit, удаление локальных дублей
2026-08-14 11:09:11 +05:00

40 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import * as React from 'react';
import styles from './RequestGrid.module.scss';
import { Icon } from '@tnsu/ui-kit';
import { IRequestType } from '../../models/types';
interface IRequestGridProps {
requests: IRequestType[];
onSelect: (request: IRequestType) => void;
}
export const RequestGrid: React.FC<IRequestGridProps> = ({ requests, onSelect }) => {
if (requests.length === 0) {
return <p className={styles.empty}>В этой категории пока нет заявок.</p>;
}
return (
<div className={styles.grid}>
{requests.map((request) => (
<button
key={request.id}
type="button"
className={styles.tile}
onClick={() => onSelect(request)}
>
<span className={styles.tileIcon}>
<Icon name={request.icon} />
</span>
<span className={styles.tileBody}>
<span className={styles.tileTitle}>{request.title}</span>
{request.description && <span className={styles.tileDesc}>{request.description}</span>}
</span>
<span className={styles.tileArrow}>
<Icon name="chevron-right" size="sm" />
</span>
</button>
))}
</div>
);
};