import SwiftUI

struct BookmarksTipView: View {
    @EnvironmentObject var userService: UserService
    
    var body: some View {
        ZStack {
            if userService.shouldShowBookmarksTip {
                VStack {
                    Spacer()
                    
                    VStack(alignment: .leading) {
                        HStack {
                            Text("Bookmark Saved!")
                                .textStyle(.headline, color: ColorName.text.color(variation: .primary, colorScheme: .dark))
                            
                            Spacer()
                            
                            ImageName.System.close.image
                                .textStyle(.headline, color: ColorName.text.color(variation: .tertiary, colorScheme: .dark))
                        }
                        
                        Divider()
                            .foregroundColor(ColorName.text.color(variation: .primary, colorScheme: .dark).opacity(0.5))
                        
                        Text("This will appear under the Bookmarks section of the Profile tab.")
                            .textStyle(.body, color: ColorName.text.color(variation: .secondary, colorScheme: .dark))
                    }
                    .padding()
                    .background(
                        RoundedRectangle(cornerRadius: 4.0)
                            .fill(ColorName.background.color(variation: .primary, colorScheme: .dark))
                            .shadow(color: ColorName.shadow.color, radius: 3, x: 0, y: 1)
                    )
                    .padding(10)
                }
                .onTapGesture {
                    userService.didSeeBookmarksTip()
                }
            } else {
                EmptyView()
            }
        }
        .transition(.opacity)
        .animation(.easeInOut, value: userService.shouldShowBookmarksTip)
    }
}
