/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see .
*/
/** @jsxRuntime automatic */
/** @jsxImportSource hono/jsx */
import {PaperclipIcon} from '@fluxer/admin/src/components/Icons';
import {CSRF_FORM_FIELD} from '@fluxer/constants/src/Cookies';
import {formatUserTag} from '@fluxer/ui/src/utils/FormatUser';
import type {FC} from 'hono/jsx';
interface Attachment {
url: string;
filename: string;
}
export interface Message {
id: string;
content: string;
timestamp: string;
author_id: string;
author_username: string;
author_discriminator: string;
channel_id: string;
guild_id?: string | null;
attachments: Array;
}
interface MessageRowProps {
basePath: string;
message: Message;
includeDeleteButton: boolean;
}
function buildMessageLookupHref(basePath: string, channelId: string, messageId: string): string {
return `${basePath}/messages?channel_id=${channelId}&message_id=${messageId}&context_limit=50`;
}
const MessageRow: FC = ({basePath, message, includeDeleteButton}) => (