32 lines
844 B
Dart
32 lines
844 B
Dart
import '../../database/database.dart';
|
|
import '../../l10n/strings.dart';
|
|
import '../../mews/document.dart';
|
|
import 'page_blocks.dart';
|
|
|
|
Future<MewsPage> buildBookmarksPage(
|
|
Uri url, {
|
|
required MewsDatabase db,
|
|
required Strings strings,
|
|
}) async {
|
|
final bookmarks = await db.bookmarksByDate();
|
|
final title = strings.t('bookmarks-title');
|
|
|
|
return internalPage(
|
|
url: url,
|
|
title: title,
|
|
body: [
|
|
...chrome(title: title, current: url, strings: strings),
|
|
if (bookmarks.isEmpty)
|
|
ParagraphBlock([MewsText(strings.t('bookmarks-empty'))])
|
|
else
|
|
itemList([
|
|
for (final bookmark in bookmarks)
|
|
itemRow(
|
|
href: bookmark.url,
|
|
label: bookmark.title ?? bookmark.url,
|
|
date: dayText(bookmark.createdAt),
|
|
),
|
|
]),
|
|
],
|
|
);
|
|
}
|