Vai al contenuto

๐Ÿ“ 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.