import {PreviewProductInARParams} from '@shopify/shop-minis-platform/actions' import {useHandleAction} from '../../internal/useHandleAction' import {useShopActions} from '../../internal/useShopActions' interface UseARPreviewReturns { /** * Previews a product in AR. Fetches the product's 3D model and launches the native AR viewer. * @param params - The parameters for the AR preview, including the product ID. * @throws Error if the product has no 3D model or if the model sources are missing. */ previewProductInAR: (params: PreviewProductInARParams) => Promise } export const useARPreview = (): UseARPreviewReturns => { const {previewProductInAR} = useShopActions() return { previewProductInAR: useHandleAction(previewProductInAR), } }