- Compress responses: page scripts and styles once (brotli or gzip, in memory) and cached immutable; pages and API JSON gzipped as they stream - Service worker serves content-named assets cache-first - Load the models modal's data when it opens (cached in localStorage) instead of shipping the model catalog in every conversation page - Lazy-load the Tiptap composer and memoize thread messages - Import lucide icons directly; twui 0.1.4 drops by-name icons from Button - bun run start builds the pages minified before serving Co-Authored-By: Claude Opus 5.5 <[email protected]>
55 lines
1.9 KiB
TypeScript
55 lines
1.9 KiB
TypeScript
import Paper from "@moduletrace/twui/elements/Paper";
|
|
import { Trash2 } from "lucide-react";
|
|
import Row from "@moduletrace/twui/layout/Row";
|
|
import Span from "@moduletrace/twui/layout/Span";
|
|
import Stack from "@moduletrace/twui/layout/Stack";
|
|
import type useLogsListInit from "../(hooks)/use-logs-list-init";
|
|
import DeleteLogsButton from "./delete-logs-button";
|
|
import LogCategoryFilter from "./log-category-filter";
|
|
|
|
type Props = {
|
|
init: ReturnType<typeof useLogsListInit>;
|
|
};
|
|
|
|
export default function LogsToolbar({ init }: Props) {
|
|
const {
|
|
count,
|
|
category,
|
|
selectCategory,
|
|
selected_ids,
|
|
afterDelete,
|
|
} = init;
|
|
|
|
return (
|
|
<Paper>
|
|
<Stack className="w-full items-stretch gap-4">
|
|
<LogCategoryFilter
|
|
category={category}
|
|
selectCategory={selectCategory}
|
|
/>
|
|
<Row className="w-full justify-between">
|
|
<Span size="small" variant="faded">
|
|
{typeof count == "number"
|
|
? `${count} log${count == 1 ? "" : "s"}`
|
|
: "--"}
|
|
</Span>
|
|
{selected_ids[0] ? (
|
|
<DeleteLogsButton
|
|
ids={selected_ids}
|
|
afterDelete={afterDelete}
|
|
title="Delete Selected Logs"
|
|
variant="outlined"
|
|
size="small"
|
|
>
|
|
<Row className="gap-2! flex-nowrap">
|
|
<Trash2 size={15} />
|
|
<Span>Delete selected ({selected_ids.length})</Span>
|
|
</Row>
|
|
</DeleteLogsButton>
|
|
) : null}
|
|
</Row>
|
|
</Stack>
|
|
</Paper>
|
|
);
|
|
}
|