3/// Renders a small icon to show the review state, e.g. a green circled tick
4/// for "Approved" images.
5struct ReviewStateIcon: ViewModifier {
6 let state: ReviewState?
9 init(_ state: ReviewState?, _ isFocused: Bool) {
11 self.isFocused = isFocused
14 func body(content: Content) -> some View {
15 if let thisState = state {
16 content.overlay(alignment: Alignment(horizontal: .leading, vertical: .top)) {
18 .foregroundStyle(.white, thisState.color())
19 .symbolRenderingMode(.palette)
21 .font(isFocused ? .title2 : .title3)
31 func reviewStateIcon(for state: ReviewState?, _ isFocused: Bool) -> some View {
32 modifier(ReviewStateIcon(state, isFocused))