core.js 738 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Core logic for the Dashboard UI.
  3. * Pure functions for rendering/formatting.
  4. */
  5. /**
  6. * Renders the dashboard state into a string (simulating a UI component).
  7. * @param {Object} state
  8. * @returns {string}
  9. */
  10. export const renderDashboard = (state) => {
  11. const { time, periods, starSign } = state;
  12. return `
  13. =========================================
  14. DASHBOARD OVERVIEW
  15. =========================================
  16. Current Time: ${time || 'Loading...'}
  17. -----------------------------------------
  18. Available Periods:
  19. ${periods ? periods.map(p => `- ${p}`).join('\n') : 'Loading...'}
  20. -----------------------------------------
  21. Visitor Star Sign: ${starSign || 'Loading...'}
  22. =========================================
  23. `;
  24. };