Represents a schedulable resource such as a room, person, or piece of equipment.
Resources are displayed as columns (in day/week resource views) or rows
(in timeline views). Events link to resources via resource_id or resource_ids.
Examples
# Simple room
%PhoenixLiveCalendar.Resource{id: "room-a", title: "Conference Room A"}
# Person with type
%PhoenixLiveCalendar.Resource{
id: "dr-smith",
title: "Dr. Smith",
type: :person,
color: "bg-accent"
}
# Hierarchical: building > room
%PhoenixLiveCalendar.Resource{id: "floor-1", title: "First Floor"}
%PhoenixLiveCalendar.Resource{id: "room-101", title: "Room 101", parent_id: "floor-1"}
Summary
Functions
Returns the children of this resource from a flat list of resources.
Returns whether this resource is a root (has no parent).
Returns only root-level resources from a list, sorted by order.
Builds a tree structure from a flat list of resources.
Types
Functions
Returns the children of this resource from a flat list of resources.
Returns whether this resource is a root (has no parent).
Returns only root-level resources from a list, sorted by order.
Builds a tree structure from a flat list of resources.
Returns a list of {resource, children} tuples where children
is recursively structured the same way.