# `PhoenixKitWeb.Components.Core.MediaThumbnail`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit_web/components/core/media_thumbnail.ex#L1)

Provides a component for resolving and rendering media file thumbnail URLs.

Handles file type detection (image, video, PDF, document) and selects
the appropriate thumbnail variant from the file's URL map.

# `resolve_url`

```elixir
@spec resolve_url(map(), :small | :medium) :: String.t() | nil
```

Resolves the best thumbnail URL for a media file.

Returns `nil` when no suitable URL is available.

## Examples

    resolve_url(file)           # small thumbnail
    resolve_url(file, :medium)  # medium preview

# `thumbnail_url`

Resolves the best thumbnail URL for a media file.

Two size modes:
- `:small` (default) — for selectors and grids: prefers thumbnail/small variants
- `:medium` — for gallery/preview: prefers medium/thumbnail variants

## Attributes

- `file` - Media file map with `file_type` and `urls` fields (required)
- `size` - Thumbnail size preference: `:small` or `:medium` (default: `:small`)

## Examples

    <.thumbnail_url file={file} :let={url}>
      <img src={url} />
    </.thumbnail_url>

    <.thumbnail_url file={file} size={:medium} :let={url}>
      <img src={url} />
    </.thumbnail_url>

## Attributes

* `file` (`:map`) (required)
* `size` (`:atom`) - Defaults to `:small`. Must be one of `:small`, or `:medium`.
## Slots

* `inner_block` (required)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
