{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "author": "Lopifi (https://lopifi.com)",
  "categories": [
    "swaps-fx",
    "finance",
    "accounting"
  ],
  "dependencies": [],
  "description": "A rate with its timestamp. Never one without the other.",
  "files": [
    {
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { useValueFlash } from \"@/hooks/ledger/use-live-value\";\nimport { cn } from \"@/lib/ledger/cn\";\nimport { formatRate } from \"@/lib/ledger/format-money\";\nimport { AsOf } from \"@/components/ledger/as-of\";\n\nexport interface RateLineProps extends React.ComponentPropsWithoutRef<\"div\"> {\n  /** Not optional. The component has no variant without it. */\n  asOf: Date;\n  from: string;\n  live?: boolean;\n  locked?: boolean;\n  rate: number;\n  to: string;\n}\n\n/* Lives in ../lib/format-money so Server Components can call it; re-exported\n   here for anything that already imports it from this module. */\nexport { formatRate } from \"@/lib/ledger/format-money\";\n\nexport const RateLine = React.forwardRef<HTMLDivElement, RateLineProps>(\n  ({ className, from, to, rate, asOf, live = false, locked = false, ...props }, ref) => {\n    const { flash, key } = useValueFlash(live ? rate : undefined);\n    return (\n      <div className={cn(\"flex flex-wrap items-center gap-2 text-caption\", className)} ref={ref} {...props}>\n        <span\n          className={cn(\n            \"numeric rounded-xs px-1 text-body text-text-primary\",\n            flash === \"positive\" && \"ledger-flash-positive\",\n            flash === \"negative\" && \"ledger-flash-negative\",\n          )}\n          key={key}\n        >\n          1 {from} = {formatRate(rate)} {to}\n        </span>\n        <span aria-hidden=\"true\" className=\"text-text-tertiary\">\n          ·\n        </span>\n        <AsOf date={asOf} />\n        {locked ? (\n          <span className=\"rounded-xs bg-accent-subtle px-1.5 py-0.5 text-caption font-medium text-accent\">\n            Locked\n          </span>\n        ) : null}\n      </div>\n    );\n  },\n);\nRateLine.displayName = \"RateLine\";\n",
      "path": "components/ledger/rate-line.tsx",
      "target": "components/ledger/rate-line.tsx",
      "type": "registry:component"
    }
  ],
  "name": "rate-line",
  "registryDependencies": [
    "@lopifi/theme",
    "@lopifi/as-of",
    "@lopifi/cn",
    "@lopifi/format-money",
    "@lopifi/use-live-value"
  ],
  "title": "RateLine",
  "type": "registry:component"
}
