import type { RefObject } from "react"; import React from "react"; import type { BottomSheetRef } from "../../../BottomSheet/BottomSheet"; import { BottomSheet } from "../../../BottomSheet/BottomSheet"; import { BottomSheetOption } from "../../../BottomSheet/components/BottomSheetOption"; import { useAtlantisI18n } from "../../../hooks/useAtlantisI18n"; export type BottomSheetOptionsSuffix = "receipt" | "image" | "file" | "video"; interface FormatFileBottomSheetProps { readonly bottomSheetRef: RefObject; readonly onPreviewPress?: () => void; readonly onRemovePress?: () => void; readonly bottomSheetOptionsSuffix?: BottomSheetOptionsSuffix; } export const FormatFileBottomSheet = ({ bottomSheetRef, onPreviewPress, onRemovePress, bottomSheetOptionsSuffix, }: FormatFileBottomSheetProps) => { const { t } = useAtlantisI18n(); const handlePress = (onPressAction: () => void) => { onPressAction(); bottomSheetRef.current?.close(); }; return ( {onPreviewPress ? ( handlePress(onPreviewPress)} /> ) : undefined} {onRemovePress ? ( handlePress(onRemovePress)} /> ) : undefined} ); };