Add “Live with Tags” Preview

This commit is contained in:
Otavio Cordeiro 2025-12-22 06:33:08 +01:00 committed by Otávio
parent 22956e834c
commit ef2ab718d7
2 changed files with 16 additions and 5 deletions

View file

@ -7,14 +7,17 @@
// MARK: - Public
@MainActor
static func makeEditorViewModel() -> EditorViewModel {
static func makeEditorViewModel(
status: WeblogEntryStatus = .draft,
tags: [String] = []
) -> EditorViewModel {
.init(
address: "alice",
body: "# This is the title\n\nThis is the body...",
date: .init(),
entryID: nil,
status: .draft,
tags: .init(),
status: status,
tags: tags,
repository: WeblogRepositoryMother.makeWeblogRepository()
)
}

View file

@ -28,7 +28,6 @@ struct EditorView: View {
makeComposeView()
makeSidebarView()
}
makeSelectedTagsView()
}
.toolbar {
@ -191,10 +190,19 @@ struct EditorView: View {
#if DEBUG
#Preview(traits: .sizeThatFitsLayout) {
#Preview("Draft", traits: .sizeThatFitsLayout) {
EditorView(
viewModel: EditorViewModelMother.makeEditorViewModel()
)
}
#Preview("Live with Tags", traits: .sizeThatFitsLayout) {
EditorView(
viewModel: EditorViewModelMother.makeEditorViewModel(
status: .live,
tags: ["Foo", "Bar"]
)
)
}
#endif