Skip to content

useAssetCard Composable ​

File Information ​

  • Path: app/composables/core/components/card/useAssetCard.ts
  • Purpose: Asset card component logic, menu items, and interactions
  • Type: Core Composable

Overview ​

Asset card component logic, menu items, and interactions

Features ​

Expand / quick view (handleExpandAsset) ​

  1. Sets stopProp = true.
  2. props.externalQuickView true: emit("quickView") (the page opens GalleryQuickViewDialog); otherwise assetViewDialog = true (built-in QuickViewDialog).
  3. onExpandAssetsCount(): unless flag === "share-link", viewAssetsCountMutation.mutateAsync({ workspace_id, asset_id }), dispatchAnalytics(body) and trackActivity(body, { source }) with source = "preview" when externalQuickView, else props.source || "card". With share-link it emits asset-view with the payload instead. Errors are logged; stopProp is reset in finally.

handleScreenClick calls handleExpandAsset for share-link cards and opens the asset page otherwise.

Return Type ​

Refer to the composable source code for return type definitions. Composables use TypeScript for type-safe return values.

Parameters ​

Refer to the composable source code for parameter definitions. Composables use TypeScript for type-safe parameters.

Usage Example ​

typescript
import { useAssetCard } from '~/composables/core/components/card/useAssetCard'

const { /* destructured return values */ } = useAssetCard()