Tell me how you would build a custom Tab component and a custom hook for a loader.
Describe the component and hook design, including accessibility, loading states, errors, cancellation, and stale-request protection. For grading, implement a Python state simulation that processes tab and loader actions.
Input: a list of tab IDs and an action list. Output: the final state containing the active tab and loader status.
def simulate_tab_loader(tabs, actions):