# `MishkaGervaz.Table.Types.Action`
[🔗](https://github.com/mishka-group/mishka_gervaz/blob/v0.0.1-alpha.3/lib/mishka_gervaz/table/types/action.ex#L1)

Built-in action type registry.

Provides lookup for built-in action types by atom name.
Action types define how row action buttons are rendered.

## Built-in Types

- `:link` - Navigation link
- `:event` - Custom event button (default)
- `:edit` - Edit action (opens form)
- `:destroy` - Delete button with confirmation
- `:update` - Ash update action trigger
- `:unarchive` - Restore archived record
- `:permanent_destroy` - Permanently delete archived record
- `:row_click` - Full-row click handler
- `:accordion` - Expandable row toggle (requires `:expand` feature)

## Custom Action Types

Implement the `MishkaGervaz.Table.Behaviours.ActionType` behaviour:

    defmodule MyApp.ActionTypes.Archive do
      @behaviour MishkaGervaz.Table.Behaviours.ActionType
      use Phoenix.Component

      @impl true
      def render(assigns, action, record, ui, target) do
        # Return rendered HEEx
      end
    end

Then use in DSL:

    row_actions do
      action :archive, type: MyApp.ActionTypes.Archive
    end

See `MishkaGervaz.Table.Behaviours.TypeRegistry` (base),
`MishkaGervaz.Table.Behaviours.ActionType`, and
`MishkaGervaz.Table.Entities.RowAction`.

# `builtin?`

```elixir
@spec builtin?(atom()) :: boolean()
```

Check if type name is registered.

# `builtin_types`

```elixir
@spec builtin_types() :: [atom()]
```

List all built-in type names.

# `default`

```elixir
@spec default() :: module() | nil
```

Get the default type module.

# `get`

```elixir
@spec get(atom()) :: module() | nil
```

Get module by type name.

Returns the module for built-in types, or the type itself
if it's already a module (for custom types).

# `get_or_passthrough`

```elixir
@spec get_or_passthrough(atom()) :: module()
```

Get module, falling back to type itself for custom modules.

Unlike `get/1` which returns nil for unknown types,
this returns the type as-is (assuming it's a custom module).

# `resolve_type`

```elixir
@spec resolve_type(map()) :: module()
```

Resolve action type module from action configuration.

Checks in order:
1. If type is a module with `render/4`, use it directly
2. If type is an atom, look up in built-in registry
3. Otherwise, default to Event action

## Examples

    iex> MishkaGervaz.Table.Types.Action.resolve_type(%{type: :link})
    MishkaGervaz.Table.Types.Action.Link

    iex> MishkaGervaz.Table.Types.Action.resolve_type(%{type: :destroy})
    MishkaGervaz.Table.Types.Action.Destroy

---

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