Download frontend/src/components/DividendAnalysis.jsx from bhuvi3/CIOAgent: direct link, hf CLI and curl.
- Browser
- Download file 2 kB
-
https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/frontend/src/components/DividendAnalysis.jsx
- Command line
-
hf download hf://spaces/bhuvi3/CIOAgent/frontend/src/components/DividendAnalysis.jsx
-
curl -L -o DividendAnalysis.jsx https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/frontend/src/components/DividendAnalysis.jsx
2 kB
| import React from "react"; | |
| export default function DividendAnalysis({ data }) { | |
| if (!data) return null; | |
| return ( | |
| <div className="section"> | |
| <h2>Dividend Analysis</h2> | |
| <div className="metrics-row"> | |
| <div className="metric-card"> | |
| <span className="metric-label">Portfolio Yield</span> | |
| <span className="metric-value">{(data.portfolio_yield * 100).toFixed(2)}%</span> | |
| </div> | |
| <div className="metric-card"> | |
| <span className="metric-label">Annual Income</span> | |
| <span className="metric-value">${data.total_annual_income.toLocaleString(undefined, { maximumFractionDigits: 0 })}</span> | |
| </div> | |
| <div className="metric-card"> | |
| <span className="metric-label">Monthly Income</span> | |
| <span className="metric-value">${data.monthly_income.toLocaleString(undefined, { maximumFractionDigits: 0 })}</span> | |
| </div> | |
| <div className="metric-card"> | |
| <span className="metric-label">Investment Basis</span> | |
| <span className="metric-value">${data.investment_amount.toLocaleString()}</span> | |
| </div> | |
| </div> | |
| <table className="data-table" style={{ marginTop: "1rem" }}> | |
| <thead> | |
| <tr> | |
| <th>Ticker</th> | |
| <th>Weight</th> | |
| <th>Div Yield</th> | |
| <th>Div Rate</th> | |
| <th>Payout Ratio</th> | |
| <th>Annual Income</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {data.holdings.map((h, i) => ( | |
| <tr key={i}> | |
| <td><strong>{h.ticker}</strong></td> | |
| <td>{(h.weight * 100).toFixed(1)}%</td> | |
| <td>{(h.dividend_yield * 100).toFixed(2)}%</td> | |
| <td>${h.dividend_rate.toFixed(2)}</td> | |
| <td>{(h.payout_ratio * 100).toFixed(0)}%</td> | |
| <td>${h.annual_income.toLocaleString(undefined, { maximumFractionDigits: 0 })}</td> | |
| </tr> | |
| ))} | |
| </tbody> | |
| </table> | |
| </div> | |
| ); | |
| } | |