import React from 'react'; import { YStack, XStack } from '@tamagui/stacks'; import { SizableText as Text } from '@tamagui/text'; import { Pressable } from '@tamagui/react-native-web-lite'; import { Sheet } from '@tamagui/sheet'; import { useTranslation } from 'react-i18next'; import { useAdminTheme } from '../theme'; type SheetProps = { open: boolean; title: string; onClose: () => void; children: React.ReactNode; footer?: React.ReactNode; /** Optional bottom offset so content sits above the bottom nav/safe-area. */ bottomOffsetPx?: number; }; export function MobileSheet({ open, title, onClose, children, footer, bottomOffsetPx = 88 }: SheetProps) { const { t } = useTranslation('mobile'); const { surface, textStrong, muted, overlay, shadow, border } = useAdminTheme(); const bottomOffset = `max(env(safe-area-inset-bottom, 0px), ${bottomOffsetPx}px)`; if (!open) { return null; } return ( { if (!next) { onClose(); } }} snapPoints={[82]} snapPointsMode="percent" dismissOnOverlayPress dismissOnSnapToBottom zIndex={100000} > {title} {t('actions.close', 'Close')} {children} {footer ? footer : null} ); }