Files
Tom Moor 7f00defd62 feat: Add archive and deletion reasons (#13784)
* feat: Add reasons for archived and deleted documents

* feat: Add deprecation reasons to archived collections

* fix: Refine deprecation reason display for readers

* feat: Accept reasons when archiving or deleting

* Support reasons in archive and delete MCP tools

* Fix placeholder after clearing content editable text

* Keep the caret before content editable placeholders

* Remove test

* feat: Add archive reasons to the confirmation dialog
2026-09-18 21:09:35 -04:00

35 lines
1.0 KiB
TypeScript

import { ArchiveIcon } from "outline-icons";
import { useTranslation } from "react-i18next";
import type Collection from "~/models/Collection";
import ErrorBoundary from "~/components/ErrorBoundary";
import { DeprecationNotice } from "~/components/DeprecationNotice";
import { DeprecatedReason } from "~/components/DeprecatedReason";
import Time from "~/components/Time";
type Props = {
collection: Collection;
};
export default function Notices({ collection }: Props) {
const { t } = useTranslation();
return (
<ErrorBoundary>
{collection.isArchived && !collection.isDeleted && (
<DeprecationNotice
icon={<ArchiveIcon />}
description={
<DeprecatedReason key={collection.id} model={collection} />
}
>
{t("Archived by {{userName}}", {
userName: collection.archivedBy?.name ?? t("Unknown"),
})}
&nbsp;
<Time dateTime={collection.archivedAt} addSuffix />
</DeprecationNotice>
)}
</ErrorBoundary>
);
}