import {
  Meta,
  Title,
  Subtitle,
  Description,
  Primary,
  Controls,
  Stories,
} from '@storybook/addon-docs/blocks';
import * as MapViewControlStories from './map-view-control.stories';

<Meta of={MapViewControlStories} />

<Title />
<Subtitle>Switches between named map views and re-frames the camera.</Subtitle>

<Description />

<Primary />

<Controls />

---

## Variations

<Stories />

---

## AI Best Practices

> [!IMPORTANT]
>
> - **One triple, two components** — `views`, `activeViewId` and `onViewChange` go to both `<Map>` and `<MapViewControl>`. The control reports the choice; the map moves the camera. Passing different values makes the buttons lie about where the camera is.
> - **Omit `onRefit` rather than passing a no-op** — the reframe button hides itself when there is nothing for it to do.
> - **An active view outranks automatic fitting** — once `activeViewId` is set, `<Map>` stops re-framing on data changes. Clear it to hand control back to `fitTo`.
> - **Overlay needs a positioned ancestor** — `variant="overlay"` positions itself absolutely.
