Files
cobble/src/pages/admin/bots/[bot_id]/(partials)/composer-attachments.tsx
T
tben dbfe48796b Make the app an installable PWA with phone layout and Web Push
Add a generated manifest, icon set, offline page and service worker that never caches authenticated HTML, plus install and update UI. Turn the rail into a drawer below md with container-query internals, dvh and safe-area handling, and reconnect the socket after visibility/network changes. Add Web Push subscriptions, presence-aware delivery, notification settings and tests.
2026-10-19 17:12:16 +01:00

32 lines
1.0 KiB
TypeScript

import Row from "@moduletrace/twui/layout/Row";
import type { PendingAttachment } from "../(hooks)/use-composer-attachments";
import ComposerAttachmentChip from "./composer-attachment-chip";
type Props = {
pending: PendingAttachment[];
onRemove: (params: { key: string }) => void;
};
/**
* The next message's files, just above the composer rule.
*/
export default function ComposerAttachments({ pending, onRemove }: Props) {
if (!pending.length) return null;
return (
<Row className="w-full max-w-container mx-auto gap-2! px-3 md:px-6 pb-3">
{pending.map((item) => (
<ComposerAttachmentChip
key={item.key}
name={item.name}
status={item.status}
attachment={item.attachment}
error={item.error}
preview_url={item.preview_url}
onRemove={() => onRemove({ key: item.key })}
/>
))}
</Row>
);
}