Skip to content

useSearchAssets Composable ​

File Information ​

  • Path: app/composables/core/components/search/useSearchAssets.ts
  • Purpose: Search results logic and asset display
  • Type: Core Composable

Overview ​

Search results logic and asset display

Features ​

Called by SearchAssets.vue as useSearchAssets(props, { emit }) with SearchAssetsProps.

  • localMode starts from props.mode; localDigitalAssets holds the rendered rows.
  • Matched In column (340c6e0): hasMatchColumn = props.matchColumn ?? localDigitalAssets.some(file => itemSearchMatches(file).length > 0). SearchBar.vue passes one shared value for assets, collages and folders so the dropdown's single header lines up; the results page does not pass it, so each tab decides from its own rows.
  • Exposes selection (toggleSelect, toggleSelectCard), navigation (openAsset(asset, openInNewTab = false)), share (openShareDialog, closeShareAssetDialog, getShareTitle, getShareDescription) and download (downloadFile) helpers used by the component.

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 { useSearchAssets } from '~/composables/core/components/search/useSearchAssets'

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