mirror of
https://github.com/outline/outline.git
synced 2026-11-28 08:14:58 +03:00
* 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
35 lines
1.0 KiB
TypeScript
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"),
|
|
})}
|
|
|
|
<Time dateTime={collection.archivedAt} addSuffix />
|
|
</DeprecationNotice>
|
|
)}
|
|
</ErrorBoundary>
|
|
);
|
|
}
|