Files
cobble/src/pages/admin/logs/(partials)/logs-toolbar.tsx
T
tbenandClaude Opus 5.5 c1a94fc9a5 Make pages load fast on mobile
- 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]>
2026-10-20 13:41:45 +01:00

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>
);
}