feat: added notifications workflow

This commit is contained in:
Тимур Городецкий
2026-08-07 10:35:28 +05:00
parent 40f9ac6c03
commit d2e137dfad
23 changed files with 490 additions and 56 deletions
@@ -21,6 +21,8 @@
}
.link {
flex: 1;
min-width: 0;
color: $navy-700;
text-decoration: none;
@@ -30,6 +32,27 @@
}
}
.removeBtn {
flex-shrink: 0;
display: inline-flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
padding: 0;
border: 1px solid $gray-300;
border-radius: $r-sm;
background: $white;
color: $gray-500;
cursor: pointer;
transition: .16s;
&:hover {
border-color: $red-500;
color: $red-500;
}
}
.empty {
color: $gray-500;
font-size: $fs-sm;
@@ -5,10 +5,12 @@ import { IAttachmentInfo } from '../../attachments/attachments.service';
interface IAttachmentListProps {
items: IAttachmentInfo[];
/** Если задан — рядом с файлом показывается кнопка удаления (режим правки). */
onRemove?: (fileName: string) => void;
}
/** Список вложений заявки как ссылки на скачивание (режим чтения/согласующего). */
export const AttachmentList: React.FC<IAttachmentListProps> = ({ items }) => {
/** Список вложений заявки как ссылки на скачивание; с onRemove — ещё и удаление. */
export const AttachmentList: React.FC<IAttachmentListProps> = ({ items, onRemove }) => {
if (items.length === 0) {
return <p className={styles.empty}>Вложений нет.</p>;
}
@@ -21,6 +23,17 @@ export const AttachmentList: React.FC<IAttachmentListProps> = ({ items }) => {
<a href={attachment.url} target="_blank" rel="noreferrer" className={styles.link}>
{attachment.fileName}
</a>
{onRemove && (
<button
type="button"
className={styles.removeBtn}
title="Удалить вложение"
aria-label={`Удалить ${attachment.fileName}`}
onClick={() => onRemove(attachment.fileName)}
>
<Icon name="trash" size="sm" />
</button>
)}
</li>
))}
</ul>