Skip to content

πŸ“ Broker Forms

Form and input components for broker creation and editing.


πŸ“ BrokerForm

The create/edit form for a broker. Used inside BrokerModal.

Broker Edit Form

πŸ“‹ Fields

Field Component Required Description
Name Text input βœ… Broker display name
Description Textarea ❌ Optional description
Base Currency CurrencySearchSelect βœ… Default currency for cash tracking
Portal URL Text input ❌ Broker website (used for favicon fallback)
Icon ImagePickerWrapper ❌ Custom broker icon
Default Plugin ImportPluginSelect ❌ Default BRIM parser for this broker
Allow Overdraft Toggle ❌ Allow negative cash balance

βœ… Validation

  • Name: Required, minimum 1 character
  • Currency: Required, must be a valid ISO 4217 code

πŸ–ΌοΈ BrokerIcon

A smart icon component with a 4-step fallback chain:

graph LR
    A["icon_url<br/><small>Custom uploaded</small>"] -->|not set| B["portal_url favicon<br/><small>Google Favicon API</small>"]
    B -->|not found| C["Plugin icon<br/><small>From BRIM plugin API</small>"]
    C -->|not found| D["Briefcase βœ‰οΈ<br/><small>Default Lucide icon</small>"]

    style A fill:#e8f5e9,stroke:#2e7d32
    style B fill:#e3f2fd,stroke:#1565c0
    style C fill:#fff3e0,stroke:#e65100
    style D fill:#f3e5f5,stroke:#7b1fa2

πŸ“ Sizes

Size Dimensions Used in
sm 24Γ—24 px Inline references, select options
md 32Γ—32 px BrokerCard, list items
lg 48Γ—48 px Broker detail page header

πŸ“‹ Key Props

Prop Type Description
iconUrl string \| null Custom icon URL (step 1)
portalUrl string \| null Broker website for favicon (step 2)
pluginCode string \| null BRIM plugin code for icon (step 3)
size 'sm' \| 'md' \| 'lg' Icon size
altText string Accessible alt text

Used by: BrokerCard, BrokerSearchSelect, broker detail page.