     @Binding var isPresented: Bool
     let detents: [UISheetPresentationController.Detent]
     let prefersGrabberVisible: Bool
-    let preferredCornerRadius: CGFloat?
     let content: (() -> Content)?
     let onDismiss: (() -> Void)?
 

        if let presentationController = hostingController.presentationController as? UISheetPresentationController {
            presentationController.detents = detents
            presentationController.prefersGrabberVisible = prefersGrabberVisible
            presentationController.preferredCornerRadius = preferredCornerRadius
        }

        // Store reference to compare later for dismissal in multi bottom sheet scenarios

    ///   - isPresented: A binding to a `Boolean` value that determines whether to present
    ///                  the sheet that you create in the modifier's `content` closure.
    ///   - detents: An object that represents a height where a sheet naturally rests.
    ///   - prefersDragIndicator: A Boolean value that determines whether the sheet shows a grabber at the top.
    ///   - onDismiss: The closure to execute when dismissing the sheet.
    ///   - content: A closure that returns the content of the sheet.
    @ViewBuilder
    func bottomSheet<Content: View>(
        isPresented: Binding<Bool>,
        detents: Set<BottomSheetDetents> = [.medium, .large],
        prefersDragIndicator: Bool? = nil,
        onDismiss: (() -> Void)? = nil,
        @ViewBuilder content: @escaping () -> Content
    ) -> some View {
        modifier {
            if #available(iOS 16, *) {
                $0.sheet(isPresented: isPresented, onDismiss: onDismiss) {
                    content()
                        .presentationDetents(Set(detents.map(\.iOS16)))
                        .modifier(let: prefersDragIndicator) { content, value in
                            content.presentationDragIndicator(value ? .visible : .hidden)
                        }
                }
            } else {
                $0.background(
                    BottomSheet(
                        isPresented: isPresented,
                        detents: detents.map(\.iOS15),
                        prefersGrabberVisible: prefersDragIndicator ?? true,
                        content: content,
                        onDismiss: onDismiss
                    )
                )
            }
        }
    }
}

