adserver-dashboard 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ci/staging.yml +191 -0
- package/.dockerignore +117 -0
- package/.env +40 -0
- package/.env.staging +38 -0
- package/.gitlab-ci.yml +16 -0
- package/DEMO_STATUS.md +579 -0
- package/Dockerfile +61 -0
- package/Influence-MW-AdServer-12-02-2026/client/index.html +17 -0
- package/Influence-MW-AdServer-12-02-2026/client/public/favicon.png +0 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/App.tsx +91 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/advanced-map-drawer.tsx +1131 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ai-recommendation-panel.tsx +379 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/app-sidebar.tsx +183 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/auto-optimize-button.tsx +184 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/availability-drawer.tsx +385 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/brand-insights-panel.tsx +87 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/create-agency-drawer.tsx +198 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/create-brand-drawer.tsx +275 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/creative-assignment.tsx +526 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/data-table-toolbar.tsx +148 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/data-table.tsx +158 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/filter-drawer.tsx +356 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/form-insights-panel.tsx +82 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/geography-selector.tsx +699 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/header-user-menu.tsx +178 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/history-drawer.tsx +313 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/inventory-availability-section.tsx +176 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/inventory-format-drawer.tsx +173 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/inventory-selector.tsx +401 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/manual-inventory-drawer.tsx +368 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/mapbox-map.tsx +368 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/market-insights-panel.tsx +202 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/media-owner-drawer.tsx +217 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/metric-card.tsx +58 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/page-header.tsx +27 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/player-status-indicator.tsx +137 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/poi-targeting-drawer.tsx +298 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/recommendation-score-badge.tsx +102 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/recommended-inventories-panel.tsx +248 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/searchable-combobox.tsx +134 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/signal-visualizations.tsx +407 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/status-badge.tsx +35 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/theme-provider.tsx +73 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/theme-toggle.tsx +37 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/traffic-slider.tsx +75 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/accordion.tsx +56 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/alert-dialog.tsx +139 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/alert.tsx +59 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/aspect-ratio.tsx +5 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/avatar.tsx +51 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/badge.tsx +38 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/breadcrumb.tsx +115 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/button.tsx +62 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/calendar.tsx +68 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/card.tsx +85 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/carousel.tsx +260 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/chart.tsx +365 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/checkbox.tsx +28 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/collapsible.tsx +11 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/command.tsx +151 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/context-menu.tsx +198 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/dialog.tsx +122 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/drawer.tsx +118 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/dropdown-menu.tsx +198 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/form.tsx +178 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/hover-card.tsx +29 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/input-otp.tsx +69 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/input.tsx +23 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/label.tsx +24 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/menubar.tsx +256 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/navigation-menu.tsx +128 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/pagination.tsx +117 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/popover.tsx +29 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/progress.tsx +28 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/radio-group.tsx +42 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/resizable.tsx +45 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/scroll-area.tsx +46 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/select.tsx +160 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/separator.tsx +29 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/sheet.tsx +140 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/sidebar.tsx +727 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/skeleton.tsx +15 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/slider.tsx +26 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/switch.tsx +27 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/table.tsx +117 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/tabs.tsx +53 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/textarea.tsx +22 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toast.tsx +127 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toaster.tsx +33 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toggle-group.tsx +61 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/toggle.tsx +43 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/ui/tooltip.tsx +30 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/vendor-stores-modal.tsx +336 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/venue-type-drawer.tsx +359 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/components/venue-type-selector.tsx +436 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/hooks/use-mobile.tsx +19 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/hooks/use-toast.ts +191 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/index.css +244 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/lib/queryClient.ts +57 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/lib/utils.ts +39 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/lib/venue-taxonomy.ts +532 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/main.tsx +5 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/assign-creative.tsx +781 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/content-hub.tsx +995 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/custom-pois.tsx +431 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/dashboard.tsx +620 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/deal-detail.tsx +1062 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/deal-form.tsx +1570 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/deals.tsx +716 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/edit-creative-assignment.tsx +1051 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/geotargeting.tsx +675 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/integrations.tsx +425 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/line-item-creatives.tsx +622 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/line-item-form.tsx +3132 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/line-items.tsx +530 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/not-found.tsx +21 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/proof-of-play-upload.tsx +479 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/proof-of-play.tsx +880 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/reports.tsx +235 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/settings.tsx +652 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/signal-form.tsx +1117 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/signals.tsx +366 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/tags.tsx +332 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/pages/venues.tsx +381 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/types/mapbox-gl-draw.d.ts +37 -0
- package/Influence-MW-AdServer-12-02-2026/client/src/types/react-simple-maps.d.ts +57 -0
- package/Influence-MW-AdServer-12-02-2026/components.json +20 -0
- package/Influence-MW-AdServer-12-02-2026/docs/PRD.md +3373 -0
- package/Influence-MW-AdServer-12-02-2026/docs/influence-feature-mapping.csv +498 -0
- package/Influence-MW-AdServer-12-02-2026/drizzle.config.ts +14 -0
- package/Influence-MW-AdServer-12-02-2026/package-lock.json +9672 -0
- package/Influence-MW-AdServer-12-02-2026/package.json +118 -0
- package/Influence-MW-AdServer-12-02-2026/postcss.config.js +6 -0
- package/Influence-MW-AdServer-12-02-2026/replit.md +91 -0
- package/Influence-MW-AdServer-12-02-2026/script/build.ts +67 -0
- package/Influence-MW-AdServer-12-02-2026/scripts/create-miro-diagrams.cjs +318 -0
- package/Influence-MW-AdServer-12-02-2026/scripts/create-remaining-diagrams.cjs +270 -0
- package/Influence-MW-AdServer-12-02-2026/server/index.ts +103 -0
- package/Influence-MW-AdServer-12-02-2026/server/recommendation-service.ts +319 -0
- package/Influence-MW-AdServer-12-02-2026/server/routes.ts +1890 -0
- package/Influence-MW-AdServer-12-02-2026/server/static.ts +19 -0
- package/Influence-MW-AdServer-12-02-2026/server/storage.ts +2058 -0
- package/Influence-MW-AdServer-12-02-2026/server/vite.ts +58 -0
- package/Influence-MW-AdServer-12-02-2026/shared/schema.ts +1595 -0
- package/Influence-MW-AdServer-12-02-2026/tailwind.config.ts +107 -0
- package/Influence-MW-AdServer-12-02-2026/tsconfig.json +23 -0
- package/Influence-MW-AdServer-12-02-2026/vite.config.ts +40 -0
- package/LINE_ITEM_BUDGET_FIELD_MAPPING.md +178 -0
- package/PCM/.env.example +92 -0
- package/PCM/README.md +558 -0
- package/PCM/docs/TEST_CASES.md +422 -0
- package/PCM/index.js +106 -0
- package/PCM/package-lock.json +3282 -0
- package/PCM/package.json +32 -0
- package/PCM/replit.md +64 -0
- package/PCM/schema.sql +495 -0
- package/PCM/scripts/export-schema.js +183 -0
- package/PCM/scripts/seed-comprehensive.js +631 -0
- package/PCM/scripts/seed-production.js +477 -0
- package/PCM/src/config/db.js +56 -0
- package/PCM/src/config/swagger.js +5975 -0
- package/PCM/src/dto/EmailRequestDTO.js +166 -0
- package/PCM/src/middleware/errorHandler.js +52 -0
- package/PCM/src/middleware/logger.js +26 -0
- package/PCM/src/migrations/001_add_campaign_mode_fields.sql +36 -0
- package/PCM/src/migrations/002_create_deal_id_counters.sql +22 -0
- package/PCM/src/migrations/003_update_publishers_column.sql +15 -0
- package/PCM/src/migrations/004_add_direct_dealtype_and_advertiser.sql +5 -0
- package/PCM/src/migrations/005_add_programmatic_fields_and_update_enums.sql +31 -0
- package/PCM/src/migrations/006_add_line_item_programmatic_fields.sql +12 -0
- package/PCM/src/migrations/007_add_line_item_direct_fields.sql +15 -0
- package/PCM/src/migrations/008_add_inventory_fields.sql +45 -0
- package/PCM/src/migrations/009_move_inventory_fields_to_metadata.sql +32 -0
- package/PCM/src/migrations/010_add_draft_status_and_line_items_count.sql +23 -0
- package/PCM/src/migrations/011_add_planning_field.sql +21 -0
- package/PCM/src/migrations/012_fix_inventory_composite_pk.sql +17 -0
- package/PCM/src/migrations/013_make_external_id_optional.sql +3 -0
- package/PCM/src/migrations/014_create_change_history.sql +38 -0
- package/PCM/src/migrations/016_create_publisher_insertion_orders.sql +33 -0
- package/PCM/src/migrations/017_fix_line_item_id_fk_reference.sql +86 -0
- package/PCM/src/migrations/018_create_approval_tables.sql +44 -0
- package/PCM/src/migrations/019_add_encrypted_token_column.sql +2 -0
- package/PCM/src/migrations/020_add_rejection_reason_to_deals.sql +10 -0
- package/PCM/src/migrations/021_add_publisher_external_id_to_inventories.sql +12 -0
- package/PCM/src/migrations/022_add_line_item_extended_fields.sql +24 -0
- package/PCM/src/migrations/023_add_base_price_fields.sql +8 -0
- package/PCM/src/migrations/run-migrations.js +46 -0
- package/PCM/src/models/ApprovalOTP.js +51 -0
- package/PCM/src/models/ApprovalToken.js +79 -0
- package/PCM/src/models/ChangeHistory.js +107 -0
- package/PCM/src/models/Deal.js +186 -0
- package/PCM/src/models/DealIdCounter.js +28 -0
- package/PCM/src/models/LineItem.js +227 -0
- package/PCM/src/models/LineItemCreative.js +89 -0
- package/PCM/src/models/LineItemInventory.js +115 -0
- package/PCM/src/models/PublisherInsertionOrder.js +93 -0
- package/PCM/src/models/TransactionHistory.js +34 -0
- package/PCM/src/models/associations.js +81 -0
- package/PCM/src/routes/approval.js +321 -0
- package/PCM/src/routes/creatives.js +437 -0
- package/PCM/src/routes/deals.js +1638 -0
- package/PCM/src/routes/digitalSignage.js +242 -0
- package/PCM/src/routes/insertionOrders.js +380 -0
- package/PCM/src/routes/lineItems.js +926 -0
- package/PCM/src/routes/system.js +384 -0
- package/PCM/src/services/ApprovalService.js +885 -0
- package/PCM/src/services/CampaignImportConverter.js +631 -0
- package/PCM/src/services/CampaignModeService.js +273 -0
- package/PCM/src/services/CampaignStatusService.js +395 -0
- package/PCM/src/services/ChangeHistoryService.js +316 -0
- package/PCM/src/services/DealIdService.js +94 -0
- package/PCM/src/services/DealResponseFormatter.js +90 -0
- package/PCM/src/services/EmailNotificationService.js +315 -0
- package/PCM/src/services/LineItemResponseFormatter.js +122 -0
- package/PCM/src/services/LineItemStatusService.js +380 -0
- package/PCM/src/tests/comprehensiveTestRunner.js +360 -0
- package/PCM/src/tests/comprehensiveTests.js +1277 -0
- package/PCM/src/tests/dealTypeUnitTests.js +1058 -0
- package/PCM/src/tests/testRunner.js +248 -0
- package/PCM/src/utils/caseConverter.js +92 -0
- package/PCM/src/utils/dealCalculations.js +206 -0
- package/PCM/src/utils/lineItemPayloadNormalizer.js +41 -0
- package/PCM/src/utils/payloadNormalizer.js +34 -0
- package/PCM/src/utils/sourceNormalizer.js +56 -0
- package/PCM/src/validators/creativeValidator.js +27 -0
- package/PCM/src/validators/dealValidator.js +203 -0
- package/PCM/src/validators/lineItemValidator.js +489 -0
- package/PCM/tests/approval-flows.test.js +238 -0
- package/PCM/tests/approval-workflow.test.js +291 -0
- package/PCM/tests/campaign-import-converter.test.js +543 -0
- package/PCM/tests/campaign-import-e2e.test.js +520 -0
- package/PCM/tests/campaign-status.test.js +539 -0
- package/PCM/tests/direct-publisher-split-reimport.test.js +460 -0
- package/PCM/tests/e2e/digital-signage.test.js +145 -0
- package/PCM/tests/e2e/search-filter-pagination.test.js +399 -0
- package/PCM/tests/e2e-comprehensive.test.js +3446 -0
- package/PCM/tests/edge-cases.test.js +340 -0
- package/PCM/tests/line-item-status.test.js +340 -0
- package/PCM/tests/seller-account-external-ids.test.js +877 -0
- package/PCM/tests/source-validation.test.js +324 -0
- package/PRD.md +3373 -0
- package/README.md +186 -0
- package/client/index.html +35 -0
- package/client/public/DEMO_STATUS.md +579 -0
- package/client/public/img/MW-logo-trans_1754045676555.png +0 -0
- package/client/public/locales/ar/approval.json +144 -0
- package/client/public/locales/ar/buyer.json +61 -0
- package/client/public/locales/ar/campaigns.json +1 -0
- package/client/public/locales/ar/common.json +218 -0
- package/client/public/locales/ar/contentHub.json +266 -0
- package/client/public/locales/ar/creatives.json +79 -0
- package/client/public/locales/ar/dashboard.json +57 -0
- package/client/public/locales/ar/deals.json +886 -0
- package/client/public/locales/ar/dsp.json +131 -0
- package/client/public/locales/ar/inventory.json +201 -0
- package/client/public/locales/ar/lineItems.json +553 -0
- package/client/public/locales/ar/navigation.json +48 -0
- package/client/public/locales/ar/wizard.json +1 -0
- package/client/public/locales/en/approval.json +144 -0
- package/client/public/locales/en/buyer.json +65 -0
- package/client/public/locales/en/campaigns.json +1 -0
- package/client/public/locales/en/common.json +218 -0
- package/client/public/locales/en/contentHub.json +266 -0
- package/client/public/locales/en/creatives.json +79 -0
- package/client/public/locales/en/dashboard.json +57 -0
- package/client/public/locales/en/deals.json +886 -0
- package/client/public/locales/en/dsp.json +131 -0
- package/client/public/locales/en/inventory.json +201 -0
- package/client/public/locales/en/lineItems.json +659 -0
- package/client/public/locales/en/navigation.json +48 -0
- package/client/public/locales/en/wizard.json +1 -0
- package/client/public/locales/ja/approval.json +144 -0
- package/client/public/locales/ja/buyer.json +61 -0
- package/client/public/locales/ja/campaigns.json +1 -0
- package/client/public/locales/ja/common.json +218 -0
- package/client/public/locales/ja/contentHub.json +266 -0
- package/client/public/locales/ja/creatives.json +79 -0
- package/client/public/locales/ja/dashboard.json +57 -0
- package/client/public/locales/ja/deals.json +886 -0
- package/client/public/locales/ja/dsp.json +131 -0
- package/client/public/locales/ja/inventory.json +201 -0
- package/client/public/locales/ja/lineItems.json +553 -0
- package/client/public/locales/ja/navigation.json +48 -0
- package/client/public/locales/ja/wizard.json +1 -0
- package/client/public/locales/zh/approval.json +144 -0
- package/client/public/locales/zh/buyer.json +61 -0
- package/client/public/locales/zh/campaigns.json +1 -0
- package/client/public/locales/zh/common.json +218 -0
- package/client/public/locales/zh/contentHub.json +266 -0
- package/client/public/locales/zh/creatives.json +79 -0
- package/client/public/locales/zh/dashboard.json +57 -0
- package/client/public/locales/zh/deals.json +886 -0
- package/client/public/locales/zh/dsp.json +131 -0
- package/client/public/locales/zh/inventory.json +201 -0
- package/client/public/locales/zh/lineItems.json +553 -0
- package/client/public/locales/zh/navigation.json +48 -0
- package/client/public/locales/zh/wizard.json +1 -0
- package/client/public/manifest.json +36 -0
- package/client/src/App.tsx +464 -0
- package/client/src/components/app-sidebar.tsx +312 -0
- package/client/src/components/approval/approval-decision-form.test.tsx +294 -0
- package/client/src/components/approval/approval-decision-form.tsx +326 -0
- package/client/src/components/approval/approval-sheet.tsx +631 -0
- package/client/src/components/approval/line-item-details-sheet.tsx +371 -0
- package/client/src/components/approval/otp-verification.test.tsx +337 -0
- package/client/src/components/approval/otp-verification.tsx +180 -0
- package/client/src/components/content-hub/bulk-transcode-dialog.tsx +379 -0
- package/client/src/components/content-hub/content-hub-manager-v2.tsx +574 -0
- package/client/src/components/content-hub/content-hub-manager.tsx +330 -0
- package/client/src/components/content-hub/creative-card.tsx +456 -0
- package/client/src/components/content-hub/creative-detail-sheet.tsx +685 -0
- package/client/src/components/content-hub/creative-filters.tsx +457 -0
- package/client/src/components/content-hub/creative-grid.tsx +329 -0
- package/client/src/components/content-hub/creative-selector.tsx +415 -0
- package/client/src/components/content-hub/creative-upload.tsx +547 -0
- package/client/src/components/content-hub/folder-dialogs.tsx +445 -0
- package/client/src/components/content-hub/folder-list.tsx +280 -0
- package/client/src/components/content-hub/review-dialogs.tsx +268 -0
- package/client/src/components/content-hub/transcode-dialog.tsx +226 -0
- package/client/src/components/creative-library/creative-details-view.tsx +446 -0
- package/client/src/components/creative-library/creative-filters-panel.tsx +203 -0
- package/client/src/components/creative-library/creative-list.tsx +360 -0
- package/client/src/components/creative-library/creative-status-badge.tsx +71 -0
- package/client/src/components/creative-library/folder-card.tsx +78 -0
- package/client/src/components/creative-library/index.ts +27 -0
- package/client/src/components/creative-library/new-creative-card.tsx +211 -0
- package/client/src/components/creative-library/upload-creative-dialog.tsx +261 -0
- package/client/src/components/dashboard-overview.tsx +109 -0
- package/client/src/components/deals/approval-history-panel.test.tsx +240 -0
- package/client/src/components/deals/approval-history-panel.tsx +156 -0
- package/client/src/components/deals/deal-status-badge.tsx +92 -0
- package/client/src/components/deals/import-from-planner-dialog.tsx +399 -0
- package/client/src/components/deals/market-insights-panel.tsx +237 -0
- package/client/src/components/deals/reopen-deal-sheet.tsx +191 -0
- package/client/src/components/deals/request-approval-sheet.test.tsx +323 -0
- package/client/src/components/deals/request-approval-sheet.tsx +136 -0
- package/client/src/components/deals/resend-approval-sheet.tsx +201 -0
- package/client/src/components/direct-campaigns/campaign-card.tsx +283 -0
- package/client/src/components/direct-campaigns/deal-filter-panel.tsx +325 -0
- package/client/src/components/inventory/advanced-filters-panel.tsx +273 -0
- package/client/src/components/inventory/csv-upload-modal.tsx +639 -0
- package/client/src/components/inventory/inventory-availability-view.tsx +486 -0
- package/client/src/components/inventory/inventory-details-sheet.tsx +376 -0
- package/client/src/components/inventory/inventory-map-view.tsx +596 -0
- package/client/src/components/inventory/inventory-settings-menu.tsx +52 -0
- package/client/src/components/language-switcher.tsx +53 -0
- package/client/src/components/line-items/campaign-forecast-panel.tsx +138 -0
- package/client/src/components/line-items/form-insights.tsx +89 -0
- package/client/src/components/line-items/geofencing/LocationCsvUploadDrawer.tsx +100 -0
- package/client/src/components/line-items/geofencing/POIDropdown.tsx +379 -0
- package/client/src/components/line-items/geofencing/SelectedLocationsSidebar.tsx +436 -0
- package/client/src/components/line-items/geofencing/ViewFileLocationDrawer.tsx +199 -0
- package/client/src/components/line-items/geofencing/components/ExistingFilesTab.tsx +268 -0
- package/client/src/components/line-items/geofencing/components/TemplateDownloadSection.tsx +59 -0
- package/client/src/components/line-items/geofencing/components/UploadTab.tsx +215 -0
- package/client/src/components/line-items/geofencing-map.tsx +1270 -0
- package/client/src/components/line-items/inventory-availability-section.tsx +178 -0
- package/client/src/components/line-items/line-item-schedule-manager.tsx +313 -0
- package/client/src/components/line-items/manual-inventory-drawer.tsx +346 -0
- package/client/src/components/line-items/planner-inventory-card.tsx +495 -0
- package/client/src/components/line-items/planner-schedule-grid.tsx +495 -0
- package/client/src/components/line-items/schedule-rule-editor.tsx +649 -0
- package/client/src/components/line-items/schedule-rule-types.ts +122 -0
- package/client/src/components/line-items/steps/creatives-step.tsx +681 -0
- package/client/src/components/line-items/steps/inventory-schedule-step.tsx +1596 -0
- package/client/src/components/line-items/steps/inventory-step.tsx +1533 -0
- package/client/src/components/line-items/steps/line-item-details-step.tsx +916 -0
- package/client/src/components/line-items/steps/schedule-step.tsx +273 -0
- package/client/src/components/line-items/steps/summary-step.tsx +680 -0
- package/client/src/components/line-items/steps/targeting-step.tsx +1708 -0
- package/client/src/components/product-switcher.tsx +105 -0
- package/client/src/components/protected-route.tsx +49 -0
- package/client/src/components/skip-link.tsx +22 -0
- package/client/src/components/stat-card.tsx +53 -0
- package/client/src/components/status-badge.tsx +96 -0
- package/client/src/components/ui/hierarchical-venue-selector.tsx +389 -0
- package/client/src/components/ui/toaster.tsx +111 -0
- package/client/src/contexts/auth-context.tsx +181 -0
- package/client/src/contexts/sidebar-state.tsx +50 -0
- package/client/src/contexts/theme-context.tsx +66 -0
- package/client/src/data/campaign-data.json +107 -0
- package/client/src/data/countries.json +22 -0
- package/client/src/hooks/use-approval.ts +366 -0
- package/client/src/hooks/use-keyboard-shortcuts.ts +74 -0
- package/client/src/hooks/use-media-query.ts +46 -0
- package/client/src/hooks/use-mobile.tsx +19 -0
- package/client/src/hooks/use-page-title.ts +21 -0
- package/client/src/hooks/use-toast.ts +195 -0
- package/client/src/index.css +694 -0
- package/client/src/lib/__tests__/accessibility.test.ts +104 -0
- package/client/src/lib/__tests__/date-utils.test.ts +199 -0
- package/client/src/lib/__tests__/dsp-buyer-api.test.ts +127 -0
- package/client/src/lib/__tests__/dsp-buyer-integration.test.ts +247 -0
- package/client/src/lib/__tests__/storage-utils.test.ts +167 -0
- package/client/src/lib/__tests__/utils.test.ts +57 -0
- package/client/src/lib/accessibility.ts +141 -0
- package/client/src/lib/api-config.ts +9 -0
- package/client/src/lib/auth-service.ts +209 -0
- package/client/src/lib/campaign-creative-api.ts +82 -0
- package/client/src/lib/company-api.ts +61 -0
- package/client/src/lib/content-hub-api.ts +407 -0
- package/client/src/lib/creative-mapper.ts +61 -0
- package/client/src/lib/date-utils.ts +119 -0
- package/client/src/lib/deal-helpers.ts +220 -0
- package/client/src/lib/dsp-buyer-api.ts +196 -0
- package/client/src/lib/geo-import-api.ts +151 -0
- package/client/src/lib/google-poi-api.ts +305 -0
- package/client/src/lib/i18n/__tests__/formatting.test.ts +202 -0
- package/client/src/lib/i18n/formatting.ts +130 -0
- package/client/src/lib/i18n/index.ts +8 -0
- package/client/src/lib/i18n-compat.ts +76 -0
- package/client/src/lib/influence-deals-api.ts +896 -0
- package/client/src/lib/inventory-api.ts +399 -0
- package/client/src/lib/oauth-service.ts +678 -0
- package/client/src/lib/poi-types.ts +75 -0
- package/client/src/lib/queryClient.ts +144 -0
- package/client/src/lib/recommendation-api.ts +380 -0
- package/client/src/lib/storage-utils.ts +104 -0
- package/client/src/lib/tolgee.ts +85 -0
- package/client/src/lib/utils.ts +0 -0
- package/client/src/main.tsx +67 -0
- package/client/src/mapbox-draw-modes.d.ts +32 -0
- package/client/src/pages/all-folders.tsx +203 -0
- package/client/src/pages/auth-callback.tsx +115 -0
- package/client/src/pages/buyer-form.tsx +339 -0
- package/client/src/pages/buyer-list.tsx +622 -0
- package/client/src/pages/content-hub.tsx +1358 -0
- package/client/src/pages/create-deal.tsx +2093 -0
- package/client/src/pages/creative-assignment-page.tsx +548 -0
- package/client/src/pages/creatives.tsx +5 -0
- package/client/src/pages/custom-pois.tsx +425 -0
- package/client/src/pages/dashboard.tsx +615 -0
- package/client/src/pages/deal-history.tsx +434 -0
- package/client/src/pages/deal-line-items.tsx +1703 -0
- package/client/src/pages/demo-status.tsx +113 -0
- package/client/src/pages/direct-campaign-details.tsx +361 -0
- package/client/src/pages/direct-campaigns-new.tsx +824 -0
- package/client/src/pages/dsp-form.tsx +803 -0
- package/client/src/pages/dsp-list.tsx +239 -0
- package/client/src/pages/folder-content.tsx +336 -0
- package/client/src/pages/integrations.tsx +429 -0
- package/client/src/pages/line-item-creatives.tsx +789 -0
- package/client/src/pages/line-item-detail-page.tsx +684 -0
- package/client/src/pages/line-item-form-page.tsx +3261 -0
- package/client/src/pages/line-item-wizard.tsx +1207 -0
- package/client/src/pages/login.tsx +154 -0
- package/client/src/pages/not-found.tsx +23 -0
- package/client/src/pages/proof-of-play.tsx +397 -0
- package/client/src/pages/public-approval.tsx +551 -0
- package/client/src/pages/reports.tsx +231 -0
- package/client/src/pages/settings.tsx +760 -0
- package/client/src/pages/signals.tsx +389 -0
- package/client/src/pages/tags.tsx +318 -0
- package/client/src/pages/test-results.tsx +328 -0
- package/client/src/store/hooks.ts +5 -0
- package/client/src/store/index.ts +15 -0
- package/client/src/store/mapMarkerLocationsSlice.ts +241 -0
- package/client/src/styles/design-tokens.css +324 -0
- package/client/src/test/setup.ts +261 -0
- package/client/src/test/test-utils.tsx +40 -0
- package/client/src/types/approval.ts +221 -0
- package/client/src/types/content-hub.ts +209 -0
- package/client/src/types/geofencing.ts +67 -0
- package/client/src/types/transcoding.ts +140 -0
- package/client/src/vite-env.d.ts +18 -0
- package/components.json +20 -0
- package/creative-api.json +1 -0
- package/docs/AI_REFERENCE.md +459 -0
- package/docs/MWDesign-Prompt.md +132 -0
- package/docs/MWDesign-System.md +344 -0
- package/docs/test-plan.md +277 -0
- package/e2e/AUTONOMOUS-TESTING.md +406 -0
- package/e2e/README.md +219 -0
- package/e2e/autonomous-flow.spec.ts +308 -0
- package/e2e/debug-sso.spec.ts +163 -0
- package/e2e/direct-campaigns.spec.ts +219 -0
- package/e2e/explore-sso.spec.ts +149 -0
- package/e2e/fixtures/auth.ts +26 -0
- package/e2e/fixtures/enhanced-test.ts +331 -0
- package/e2e/pagination.spec.ts +280 -0
- package/e2e/view-toggle.spec.ts +312 -0
- package/generated-icon.png +0 -0
- package/i18next-scanner.config.cjs +46 -0
- package/package.json +141 -0
- package/playwright.config.ts +93 -0
- package/postcss.config.js +6 -0
- package/replit.md +196 -0
- package/screenshot-after-login.png +0 -0
- package/screenshot-contenthub-grid.png +0 -0
- package/screenshot-contenthub-list-fixed.png +0 -0
- package/screenshot-contenthub-list.png +0 -0
- package/screenshot-create-deal.png +0 -0
- package/screenshot-dashboard.png +0 -0
- package/screenshot-deals.png +0 -0
- package/screenshot-login-filled.png +0 -0
- package/screenshot-login.png +0 -0
- package/screenshot.mjs +24 -0
- package/scripts/deploy-stg.sh +185 -0
- package/shared/direct-io-schema.ts +383 -0
- package/shared/schema.ts +439 -0
- package/shared/screen-types.ts +149 -0
- package/springdocDefault.json +1 -0
- package/swagger-ui-bundle.js +2 -0
- package/swagger-ui-init.js +10316 -0
- package/tailwind.config.ts +282 -0
- package/terraform/README.md +306 -0
- package/terraform/cloudfront.tf +289 -0
- package/terraform/ecs.tf +727 -0
- package/terraform/environments/dev.tfvars +59 -0
- package/terraform/environments/production.tfvars +60 -0
- package/terraform/main.tf +47 -0
- package/terraform/outputs.tf +145 -0
- package/terraform/s3.tf +192 -0
- package/terraform/variables.tf +226 -0
- package/terraform/waf.tf +165 -0
- package/terraform-frontend/.terraform.lock.hcl +25 -0
- package/terraform-frontend/README.md +85 -0
- package/terraform-frontend/cloudfront.tf +125 -0
- package/terraform-frontend/main.tf +31 -0
- package/terraform-frontend/outputs.tf +24 -0
- package/terraform-frontend/terraform.tfvars +12 -0
- package/terraform-frontend/variables.tf +53 -0
- package/tsconfig.json +23 -0
- package/vite.config.ts +226 -0
- package/vitest.config.ts +56 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useState, ReactNode } from "react";
|
|
2
|
+
import { Check, ChevronsUpDown } from "lucide-react";
|
|
3
|
+
import { cn } from "@/lib/utils";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Command,
|
|
7
|
+
CommandEmpty,
|
|
8
|
+
CommandGroup,
|
|
9
|
+
CommandInput,
|
|
10
|
+
CommandItem,
|
|
11
|
+
CommandList,
|
|
12
|
+
CommandSeparator,
|
|
13
|
+
} from "@/components/ui/command";
|
|
14
|
+
import {
|
|
15
|
+
Popover,
|
|
16
|
+
PopoverContent,
|
|
17
|
+
PopoverTrigger,
|
|
18
|
+
} from "@/components/ui/popover";
|
|
19
|
+
|
|
20
|
+
export interface ComboboxOption {
|
|
21
|
+
value: string;
|
|
22
|
+
label: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface SearchableComboboxProps {
|
|
28
|
+
options: ComboboxOption[];
|
|
29
|
+
value?: string;
|
|
30
|
+
onValueChange: (value: string) => void;
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
searchPlaceholder?: string;
|
|
33
|
+
emptyMessage?: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
className?: string;
|
|
36
|
+
"data-testid"?: string;
|
|
37
|
+
footer?: ReactNode;
|
|
38
|
+
onFooterClick?: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function SearchableCombobox({
|
|
42
|
+
options,
|
|
43
|
+
value,
|
|
44
|
+
onValueChange,
|
|
45
|
+
placeholder = "Select an option...",
|
|
46
|
+
searchPlaceholder = "Search...",
|
|
47
|
+
emptyMessage = "No results found.",
|
|
48
|
+
disabled = false,
|
|
49
|
+
className,
|
|
50
|
+
"data-testid": testId,
|
|
51
|
+
footer,
|
|
52
|
+
onFooterClick,
|
|
53
|
+
}: SearchableComboboxProps) {
|
|
54
|
+
const [open, setOpen] = useState(false);
|
|
55
|
+
|
|
56
|
+
const selectedOption = options.find((option) => option.value === value);
|
|
57
|
+
|
|
58
|
+
const handleFooterClick = () => {
|
|
59
|
+
setOpen(false);
|
|
60
|
+
onFooterClick?.();
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
65
|
+
<PopoverTrigger asChild>
|
|
66
|
+
<Button
|
|
67
|
+
variant="outline"
|
|
68
|
+
role="combobox"
|
|
69
|
+
aria-expanded={open}
|
|
70
|
+
className={cn(
|
|
71
|
+
"w-full justify-between font-normal",
|
|
72
|
+
!value && "text-muted-foreground",
|
|
73
|
+
className
|
|
74
|
+
)}
|
|
75
|
+
disabled={disabled}
|
|
76
|
+
data-testid={testId}
|
|
77
|
+
>
|
|
78
|
+
{selectedOption ? selectedOption.label : placeholder}
|
|
79
|
+
<ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50" />
|
|
80
|
+
</Button>
|
|
81
|
+
</PopoverTrigger>
|
|
82
|
+
<PopoverContent className="w-[--radix-popover-trigger-width] p-0" align="start">
|
|
83
|
+
<Command>
|
|
84
|
+
<CommandInput placeholder={searchPlaceholder} />
|
|
85
|
+
<CommandList>
|
|
86
|
+
<CommandEmpty>{emptyMessage}</CommandEmpty>
|
|
87
|
+
<CommandGroup>
|
|
88
|
+
{options.map((option) => (
|
|
89
|
+
<CommandItem
|
|
90
|
+
key={option.value}
|
|
91
|
+
value={option.label}
|
|
92
|
+
disabled={option.disabled}
|
|
93
|
+
onSelect={() => {
|
|
94
|
+
if (!option.disabled) {
|
|
95
|
+
onValueChange(option.value);
|
|
96
|
+
setOpen(false);
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
99
|
+
className={cn(option.disabled && "opacity-50 cursor-not-allowed")}
|
|
100
|
+
data-testid={`option-${option.value}`}
|
|
101
|
+
>
|
|
102
|
+
<Check
|
|
103
|
+
className={cn(
|
|
104
|
+
"mr-2 h-4 w-4 shrink-0",
|
|
105
|
+
value === option.value ? "opacity-100" : "opacity-0"
|
|
106
|
+
)}
|
|
107
|
+
/>
|
|
108
|
+
<div className="flex flex-col">
|
|
109
|
+
<span>{option.label}</span>
|
|
110
|
+
{option.description && (
|
|
111
|
+
<span className="text-xs text-muted-foreground">{option.description}</span>
|
|
112
|
+
)}
|
|
113
|
+
</div>
|
|
114
|
+
</CommandItem>
|
|
115
|
+
))}
|
|
116
|
+
</CommandGroup>
|
|
117
|
+
</CommandList>
|
|
118
|
+
{footer && (
|
|
119
|
+
<>
|
|
120
|
+
<CommandSeparator />
|
|
121
|
+
<div
|
|
122
|
+
className="p-2 cursor-pointer"
|
|
123
|
+
onClick={handleFooterClick}
|
|
124
|
+
data-testid="combobox-footer"
|
|
125
|
+
>
|
|
126
|
+
{footer}
|
|
127
|
+
</div>
|
|
128
|
+
</>
|
|
129
|
+
)}
|
|
130
|
+
</Command>
|
|
131
|
+
</PopoverContent>
|
|
132
|
+
</Popover>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { Sun, Cloud, CloudRain, CloudSnow, Wind } from "lucide-react";
|
|
3
|
+
import {
|
|
4
|
+
Select,
|
|
5
|
+
SelectContent,
|
|
6
|
+
SelectItem,
|
|
7
|
+
SelectTrigger,
|
|
8
|
+
SelectValue,
|
|
9
|
+
} from "@/components/ui/select";
|
|
10
|
+
import { Button } from "@/components/ui/button";
|
|
11
|
+
|
|
12
|
+
interface RuleData {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
conditionType: string;
|
|
16
|
+
parameters: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
20
|
+
const HOURS = ["7AM", "8AM", "9AM", "10AM", "11AM", "12PM", "1PM", "2PM", "3PM", "4PM", "5PM", "6PM", "7PM", "8PM", "9PM", "10PM", "11PM"];
|
|
21
|
+
|
|
22
|
+
function generateFootfallData(): number[][] {
|
|
23
|
+
return DAYS.map(() =>
|
|
24
|
+
HOURS.map(() => Math.floor(Math.random() * 3))
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getBusyColor(level: number): string {
|
|
29
|
+
switch (level) {
|
|
30
|
+
case 0:
|
|
31
|
+
return "#22c55e";
|
|
32
|
+
case 1:
|
|
33
|
+
return "#eab308";
|
|
34
|
+
case 2:
|
|
35
|
+
return "#ef4444";
|
|
36
|
+
default:
|
|
37
|
+
return "#22c55e";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getBusyLabel(level: number): string {
|
|
42
|
+
switch (level) {
|
|
43
|
+
case 0:
|
|
44
|
+
return "Not Busy";
|
|
45
|
+
case 1:
|
|
46
|
+
return "Little Busy";
|
|
47
|
+
case 2:
|
|
48
|
+
return "Too Busy";
|
|
49
|
+
default:
|
|
50
|
+
return "Not Busy";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function FootfallVisualization() {
|
|
55
|
+
const [data] = useState(generateFootfallData);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className="space-y-4">
|
|
59
|
+
<div className="flex items-center justify-between gap-4 flex-wrap">
|
|
60
|
+
<Select defaultValue="all">
|
|
61
|
+
<SelectTrigger className="w-40" data-testid="select-footfall-location">
|
|
62
|
+
<SelectValue placeholder="All Locations" />
|
|
63
|
+
</SelectTrigger>
|
|
64
|
+
<SelectContent>
|
|
65
|
+
<SelectItem value="all">All Locations</SelectItem>
|
|
66
|
+
<SelectItem value="store1">Store 1</SelectItem>
|
|
67
|
+
<SelectItem value="store2">Store 2</SelectItem>
|
|
68
|
+
</SelectContent>
|
|
69
|
+
</Select>
|
|
70
|
+
<span className="text-sm text-muted-foreground">Jan 20 - Jan 26, 2026</span>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<h3 className="font-semibold text-center">Average weekly visitor forecast</h3>
|
|
74
|
+
|
|
75
|
+
<div className="overflow-x-auto">
|
|
76
|
+
<div className="min-w-[600px]">
|
|
77
|
+
<div className="flex">
|
|
78
|
+
<div className="w-12" />
|
|
79
|
+
<div className="flex-1 grid" style={{ gridTemplateColumns: `repeat(${HOURS.length}, minmax(0, 1fr))` }}>
|
|
80
|
+
{HOURS.map((hour, i) => (
|
|
81
|
+
<div key={i} className="text-xs text-muted-foreground text-center px-0.5">
|
|
82
|
+
{i % 2 === 0 ? hour : ""}
|
|
83
|
+
</div>
|
|
84
|
+
))}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
{DAYS.map((day, dayIndex) => (
|
|
89
|
+
<div key={day} className="flex items-center">
|
|
90
|
+
<div className="w-12 text-xs text-muted-foreground">{day}</div>
|
|
91
|
+
<div className="flex-1 grid gap-0.5" style={{ gridTemplateColumns: `repeat(${HOURS.length}, minmax(0, 1fr))` }}>
|
|
92
|
+
{data[dayIndex].map((level, hourIndex) => (
|
|
93
|
+
<div
|
|
94
|
+
key={hourIndex}
|
|
95
|
+
className="h-6 rounded-sm"
|
|
96
|
+
style={{ backgroundColor: getBusyColor(level) }}
|
|
97
|
+
title={`${day} ${HOURS[hourIndex]}: ${getBusyLabel(level)}`}
|
|
98
|
+
data-testid={`heatmap-cell-${dayIndex}-${hourIndex}`}
|
|
99
|
+
/>
|
|
100
|
+
))}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
))}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div className="flex items-center justify-center gap-6 pt-2">
|
|
108
|
+
{[0, 1, 2].map((level) => (
|
|
109
|
+
<div key={level} className="flex items-center gap-2">
|
|
110
|
+
<div
|
|
111
|
+
className="w-4 h-4 rounded-sm"
|
|
112
|
+
style={{ backgroundColor: getBusyColor(level) }}
|
|
113
|
+
/>
|
|
114
|
+
<span className="text-xs text-muted-foreground">{getBusyLabel(level)}</span>
|
|
115
|
+
</div>
|
|
116
|
+
))}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const WEATHER_DATA = [
|
|
123
|
+
{ time: "6AM", temp: 18, condition: "sunny" },
|
|
124
|
+
{ time: "9AM", temp: 22, condition: "sunny" },
|
|
125
|
+
{ time: "12PM", temp: 28, condition: "cloudy" },
|
|
126
|
+
{ time: "3PM", temp: 32, condition: "sunny" },
|
|
127
|
+
{ time: "6PM", temp: 26, condition: "cloudy" },
|
|
128
|
+
{ time: "9PM", temp: 20, condition: "rainy" },
|
|
129
|
+
];
|
|
130
|
+
|
|
131
|
+
function getWeatherIcon(condition: string) {
|
|
132
|
+
switch (condition) {
|
|
133
|
+
case "sunny":
|
|
134
|
+
return <Sun className="h-4 w-4 text-yellow-500" />;
|
|
135
|
+
case "cloudy":
|
|
136
|
+
return <Cloud className="h-4 w-4 text-gray-400" />;
|
|
137
|
+
case "rainy":
|
|
138
|
+
return <CloudRain className="h-4 w-4 text-blue-400" />;
|
|
139
|
+
case "snowy":
|
|
140
|
+
return <CloudSnow className="h-4 w-4 text-blue-200" />;
|
|
141
|
+
default:
|
|
142
|
+
return <Wind className="h-4 w-4 text-gray-300" />;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getTempColor(temp: number): string {
|
|
147
|
+
if (temp <= 15) return "#3b82f6";
|
|
148
|
+
if (temp <= 22) return "#22c55e";
|
|
149
|
+
if (temp <= 28) return "#eab308";
|
|
150
|
+
return "#ef4444";
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function WeatherVisualization() {
|
|
154
|
+
const [period, setPeriod] = useState("day");
|
|
155
|
+
const maxTemp = Math.max(...WEATHER_DATA.map((d) => d.temp));
|
|
156
|
+
const minTemp = Math.min(...WEATHER_DATA.map((d) => d.temp));
|
|
157
|
+
const tempRange = maxTemp - minTemp || 1;
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<div className="space-y-4">
|
|
161
|
+
<div className="flex items-center justify-between gap-4 flex-wrap">
|
|
162
|
+
<div className="flex gap-1">
|
|
163
|
+
{["Hour", "Day", "Week"].map((p) => (
|
|
164
|
+
<Button
|
|
165
|
+
key={p}
|
|
166
|
+
variant={period === p.toLowerCase() ? "default" : "outline"}
|
|
167
|
+
size="sm"
|
|
168
|
+
onClick={() => setPeriod(p.toLowerCase())}
|
|
169
|
+
data-testid={`button-period-${p.toLowerCase()}`}
|
|
170
|
+
>
|
|
171
|
+
{p}
|
|
172
|
+
</Button>
|
|
173
|
+
))}
|
|
174
|
+
</div>
|
|
175
|
+
<Select defaultValue="current">
|
|
176
|
+
<SelectTrigger className="w-40" data-testid="select-weather-location">
|
|
177
|
+
<SelectValue placeholder="Location" />
|
|
178
|
+
</SelectTrigger>
|
|
179
|
+
<SelectContent>
|
|
180
|
+
<SelectItem value="current">Current Location</SelectItem>
|
|
181
|
+
<SelectItem value="new_york">New York</SelectItem>
|
|
182
|
+
<SelectItem value="london">London</SelectItem>
|
|
183
|
+
</SelectContent>
|
|
184
|
+
</Select>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<h3 className="font-semibold text-center">Weather Forecast</h3>
|
|
188
|
+
|
|
189
|
+
<div className="relative h-48 border-b border-l border-border">
|
|
190
|
+
<div className="absolute left-0 top-0 bottom-0 w-8 flex flex-col justify-between text-xs text-muted-foreground py-2">
|
|
191
|
+
<span>{maxTemp}°</span>
|
|
192
|
+
<span>{Math.round((maxTemp + minTemp) / 2)}°</span>
|
|
193
|
+
<span>{minTemp}°</span>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<div className="ml-8 h-full relative">
|
|
197
|
+
<svg className="w-full h-full" preserveAspectRatio="none">
|
|
198
|
+
<defs>
|
|
199
|
+
<linearGradient id="tempGradient" x1="0" y1="0" x2="0" y2="1">
|
|
200
|
+
<stop offset="0%" stopColor="#ef4444" stopOpacity="0.3" />
|
|
201
|
+
<stop offset="100%" stopColor="#3b82f6" stopOpacity="0.1" />
|
|
202
|
+
</linearGradient>
|
|
203
|
+
</defs>
|
|
204
|
+
<path
|
|
205
|
+
d={`M 0 ${((maxTemp - WEATHER_DATA[0].temp) / tempRange) * 100}% ${WEATHER_DATA.map((d, i) => {
|
|
206
|
+
const x = (i / (WEATHER_DATA.length - 1)) * 100;
|
|
207
|
+
const y = ((maxTemp - d.temp) / tempRange) * 100;
|
|
208
|
+
return `L ${x}% ${y}%`;
|
|
209
|
+
}).join(" ")} L 100% 100% L 0 100% Z`}
|
|
210
|
+
fill="url(#tempGradient)"
|
|
211
|
+
/>
|
|
212
|
+
<polyline
|
|
213
|
+
points={WEATHER_DATA.map((d, i) => {
|
|
214
|
+
const x = (i / (WEATHER_DATA.length - 1)) * 100;
|
|
215
|
+
const y = ((maxTemp - d.temp) / tempRange) * 100;
|
|
216
|
+
return `${x}%,${y}%`;
|
|
217
|
+
}).join(" ")}
|
|
218
|
+
fill="none"
|
|
219
|
+
stroke="#ef4444"
|
|
220
|
+
strokeWidth="2"
|
|
221
|
+
/>
|
|
222
|
+
</svg>
|
|
223
|
+
|
|
224
|
+
{WEATHER_DATA.map((d, i) => {
|
|
225
|
+
const x = (i / (WEATHER_DATA.length - 1)) * 100;
|
|
226
|
+
const y = ((maxTemp - d.temp) / tempRange) * 100;
|
|
227
|
+
return (
|
|
228
|
+
<div
|
|
229
|
+
key={i}
|
|
230
|
+
className="absolute flex flex-col items-center"
|
|
231
|
+
style={{
|
|
232
|
+
left: `${x}%`,
|
|
233
|
+
top: `${y}%`,
|
|
234
|
+
transform: "translate(-50%, -100%)",
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
{getWeatherIcon(d.condition)}
|
|
238
|
+
<span className="text-xs font-medium" style={{ color: getTempColor(d.temp) }}>
|
|
239
|
+
{d.temp}°
|
|
240
|
+
</span>
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
})}
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div className="flex justify-between ml-8 text-xs text-muted-foreground">
|
|
248
|
+
{WEATHER_DATA.map((d, i) => (
|
|
249
|
+
<span key={i}>{d.time}</span>
|
|
250
|
+
))}
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const AUDIENCE_SEGMENTS = [
|
|
257
|
+
{ name: "High Intent Shoppers", percentage: 35, color: "#3b82f6" },
|
|
258
|
+
{ name: "Frequent Visitors", percentage: 28, color: "#22c55e" },
|
|
259
|
+
{ name: "New Customers", percentage: 22, color: "#eab308" },
|
|
260
|
+
{ name: "Loyalty Members", percentage: 15, color: "#ef4444" },
|
|
261
|
+
];
|
|
262
|
+
|
|
263
|
+
export function AudiencesVisualization() {
|
|
264
|
+
return (
|
|
265
|
+
<div className="space-y-4">
|
|
266
|
+
<h3 className="font-semibold text-center">Audience Segment Analysis</h3>
|
|
267
|
+
|
|
268
|
+
<div className="space-y-3">
|
|
269
|
+
{AUDIENCE_SEGMENTS.map((segment, i) => (
|
|
270
|
+
<div key={i} className="space-y-1">
|
|
271
|
+
<div className="flex justify-between text-sm">
|
|
272
|
+
<span>{segment.name}</span>
|
|
273
|
+
<span className="font-medium">{segment.percentage}%</span>
|
|
274
|
+
</div>
|
|
275
|
+
<div className="h-6 bg-muted rounded-full overflow-hidden">
|
|
276
|
+
<div
|
|
277
|
+
className="h-full rounded-full transition-all duration-500"
|
|
278
|
+
style={{
|
|
279
|
+
width: `${segment.percentage}%`,
|
|
280
|
+
backgroundColor: segment.color,
|
|
281
|
+
}}
|
|
282
|
+
data-testid={`audience-bar-${i}`}
|
|
283
|
+
/>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
))}
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
<div className="pt-4 border-t">
|
|
290
|
+
<div className="text-sm text-muted-foreground text-center">
|
|
291
|
+
Total Audience Reach: <span className="font-semibold text-foreground">1.2M</span>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
const SEARCH_TRENDS = [
|
|
299
|
+
{ date: "Jan 20", value: 45 },
|
|
300
|
+
{ date: "Jan 21", value: 52 },
|
|
301
|
+
{ date: "Jan 22", value: 48 },
|
|
302
|
+
{ date: "Jan 23", value: 68 },
|
|
303
|
+
{ date: "Jan 24", value: 82 },
|
|
304
|
+
{ date: "Jan 25", value: 75 },
|
|
305
|
+
{ date: "Jan 26", value: 90 },
|
|
306
|
+
];
|
|
307
|
+
|
|
308
|
+
export function SearchVisualization() {
|
|
309
|
+
const maxValue = Math.max(...SEARCH_TRENDS.map((d) => d.value));
|
|
310
|
+
const minValue = Math.min(...SEARCH_TRENDS.map((d) => d.value));
|
|
311
|
+
const valueRange = maxValue - minValue || 1;
|
|
312
|
+
|
|
313
|
+
return (
|
|
314
|
+
<div className="space-y-4">
|
|
315
|
+
<h3 className="font-semibold text-center">Search Keyword Trends</h3>
|
|
316
|
+
|
|
317
|
+
<div className="relative h-48 border-b border-l border-border">
|
|
318
|
+
<div className="absolute left-0 top-0 bottom-0 w-8 flex flex-col justify-between text-xs text-muted-foreground py-2">
|
|
319
|
+
<span>{maxValue}</span>
|
|
320
|
+
<span>{Math.round((maxValue + minValue) / 2)}</span>
|
|
321
|
+
<span>{minValue}</span>
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div className="ml-8 h-full relative">
|
|
325
|
+
<svg className="w-full h-full" preserveAspectRatio="none">
|
|
326
|
+
<defs>
|
|
327
|
+
<linearGradient id="searchGradient" x1="0" y1="0" x2="0" y2="1">
|
|
328
|
+
<stop offset="0%" stopColor="#3b82f6" stopOpacity="0.3" />
|
|
329
|
+
<stop offset="100%" stopColor="#3b82f6" stopOpacity="0.05" />
|
|
330
|
+
</linearGradient>
|
|
331
|
+
</defs>
|
|
332
|
+
<path
|
|
333
|
+
d={`M 0 ${((maxValue - SEARCH_TRENDS[0].value) / valueRange) * 100}% ${SEARCH_TRENDS.map((d, i) => {
|
|
334
|
+
const x = (i / (SEARCH_TRENDS.length - 1)) * 100;
|
|
335
|
+
const y = ((maxValue - d.value) / valueRange) * 100;
|
|
336
|
+
return `L ${x}% ${y}%`;
|
|
337
|
+
}).join(" ")} L 100% 100% L 0 100% Z`}
|
|
338
|
+
fill="url(#searchGradient)"
|
|
339
|
+
/>
|
|
340
|
+
<polyline
|
|
341
|
+
points={SEARCH_TRENDS.map((d, i) => {
|
|
342
|
+
const x = (i / (SEARCH_TRENDS.length - 1)) * 100;
|
|
343
|
+
const y = ((maxValue - d.value) / valueRange) * 100;
|
|
344
|
+
return `${x}%,${y}%`;
|
|
345
|
+
}).join(" ")}
|
|
346
|
+
fill="none"
|
|
347
|
+
stroke="#3b82f6"
|
|
348
|
+
strokeWidth="2"
|
|
349
|
+
/>
|
|
350
|
+
</svg>
|
|
351
|
+
|
|
352
|
+
{SEARCH_TRENDS.map((d, i) => {
|
|
353
|
+
const x = (i / (SEARCH_TRENDS.length - 1)) * 100;
|
|
354
|
+
const y = ((maxValue - d.value) / valueRange) * 100;
|
|
355
|
+
return (
|
|
356
|
+
<div
|
|
357
|
+
key={i}
|
|
358
|
+
className="absolute w-3 h-3 bg-blue-500 rounded-full border-2 border-background"
|
|
359
|
+
style={{
|
|
360
|
+
left: `${x}%`,
|
|
361
|
+
top: `${y}%`,
|
|
362
|
+
transform: "translate(-50%, -50%)",
|
|
363
|
+
}}
|
|
364
|
+
title={`${d.date}: Index ${d.value}`}
|
|
365
|
+
data-testid={`search-point-${i}`}
|
|
366
|
+
/>
|
|
367
|
+
);
|
|
368
|
+
})}
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
|
|
372
|
+
<div className="flex justify-between ml-8 text-xs text-muted-foreground">
|
|
373
|
+
{SEARCH_TRENDS.map((d, i) => (
|
|
374
|
+
<span key={i}>{d.date}</span>
|
|
375
|
+
))}
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<div className="pt-2 text-center text-sm text-muted-foreground">
|
|
379
|
+
Keyword Index Value: <span className="font-semibold text-foreground">{SEARCH_TRENDS[SEARCH_TRENDS.length - 1].value}</span>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
interface SignalVisualizationProps {
|
|
386
|
+
type: string;
|
|
387
|
+
rules: RuleData[];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export function SignalVisualization({ type, rules }: SignalVisualizationProps) {
|
|
391
|
+
if (!type) {
|
|
392
|
+
return null;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
switch (type) {
|
|
396
|
+
case "footfall":
|
|
397
|
+
return <FootfallVisualization />;
|
|
398
|
+
case "weather":
|
|
399
|
+
return <WeatherVisualization />;
|
|
400
|
+
case "audiences":
|
|
401
|
+
return <AudiencesVisualization />;
|
|
402
|
+
case "search":
|
|
403
|
+
return <SearchVisualization />;
|
|
404
|
+
default:
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Badge } from "@/components/ui/badge";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
|
|
4
|
+
interface StatusBadgeProps {
|
|
5
|
+
status: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const statusStyles: Record<string, string> = {
|
|
10
|
+
active: "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/20",
|
|
11
|
+
draft: "bg-slate-500/15 text-slate-600 dark:text-slate-400 border-slate-500/20",
|
|
12
|
+
pending: "bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/20",
|
|
13
|
+
paused: "bg-orange-500/15 text-orange-600 dark:text-orange-400 border-orange-500/20",
|
|
14
|
+
completed: "bg-blue-500/15 text-blue-600 dark:text-blue-400 border-blue-500/20",
|
|
15
|
+
cancelled: "bg-red-500/15 text-red-600 dark:text-red-400 border-red-500/20",
|
|
16
|
+
inactive: "bg-slate-500/15 text-slate-600 dark:text-slate-400 border-slate-500/20",
|
|
17
|
+
maintenance: "bg-purple-500/15 text-purple-600 dark:text-purple-400 border-purple-500/20",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function StatusBadge({ status, className }: StatusBadgeProps) {
|
|
21
|
+
const style = statusStyles[status.toLowerCase()] || statusStyles.draft;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Badge
|
|
25
|
+
variant="outline"
|
|
26
|
+
className={cn(
|
|
27
|
+
"capitalize font-medium border",
|
|
28
|
+
style,
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
{status}
|
|
33
|
+
</Badge>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
type Theme = "dark" | "light" | "system";
|
|
4
|
+
|
|
5
|
+
type ThemeProviderProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
defaultTheme?: Theme;
|
|
8
|
+
storageKey?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type ThemeProviderState = {
|
|
12
|
+
theme: Theme;
|
|
13
|
+
setTheme: (theme: Theme) => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const initialState: ThemeProviderState = {
|
|
17
|
+
theme: "light",
|
|
18
|
+
setTheme: () => null,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ThemeProviderContext = createContext<ThemeProviderState>(initialState);
|
|
22
|
+
|
|
23
|
+
export function ThemeProvider({
|
|
24
|
+
children,
|
|
25
|
+
defaultTheme = "light",
|
|
26
|
+
storageKey = "theme",
|
|
27
|
+
...props
|
|
28
|
+
}: ThemeProviderProps) {
|
|
29
|
+
const [theme, setTheme] = useState<Theme>(
|
|
30
|
+
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const root = window.document.documentElement;
|
|
35
|
+
|
|
36
|
+
root.classList.remove("light", "dark");
|
|
37
|
+
|
|
38
|
+
if (theme === "system") {
|
|
39
|
+
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
|
|
40
|
+
.matches
|
|
41
|
+
? "dark"
|
|
42
|
+
: "light";
|
|
43
|
+
|
|
44
|
+
root.classList.add(systemTheme);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
root.classList.add(theme);
|
|
49
|
+
}, [theme]);
|
|
50
|
+
|
|
51
|
+
const value = {
|
|
52
|
+
theme,
|
|
53
|
+
setTheme: (theme: Theme) => {
|
|
54
|
+
localStorage.setItem(storageKey, theme);
|
|
55
|
+
setTheme(theme);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<ThemeProviderContext.Provider {...props} value={value}>
|
|
61
|
+
{children}
|
|
62
|
+
</ThemeProviderContext.Provider>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const useTheme = () => {
|
|
67
|
+
const context = useContext(ThemeProviderContext);
|
|
68
|
+
|
|
69
|
+
if (context === undefined)
|
|
70
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
71
|
+
|
|
72
|
+
return context;
|
|
73
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Moon, Sun } from "lucide-react";
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
|
|
5
|
+
export function ThemeToggle() {
|
|
6
|
+
const [theme, setTheme] = useState<"light" | "dark">("dark");
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const savedTheme = localStorage.getItem("theme") as "light" | "dark" | null;
|
|
10
|
+
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
11
|
+
const initialTheme = savedTheme || (prefersDark ? "dark" : "light");
|
|
12
|
+
setTheme(initialTheme);
|
|
13
|
+
document.documentElement.classList.toggle("dark", initialTheme === "dark");
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
const toggleTheme = () => {
|
|
17
|
+
const newTheme = theme === "light" ? "dark" : "light";
|
|
18
|
+
setTheme(newTheme);
|
|
19
|
+
localStorage.setItem("theme", newTheme);
|
|
20
|
+
document.documentElement.classList.toggle("dark", newTheme === "dark");
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Button
|
|
25
|
+
variant="ghost"
|
|
26
|
+
size="icon"
|
|
27
|
+
onClick={toggleTheme}
|
|
28
|
+
data-testid="button-theme-toggle"
|
|
29
|
+
>
|
|
30
|
+
{theme === "light" ? (
|
|
31
|
+
<Moon className="h-4 w-4" />
|
|
32
|
+
) : (
|
|
33
|
+
<Sun className="h-4 w-4" />
|
|
34
|
+
)}
|
|
35
|
+
</Button>
|
|
36
|
+
);
|
|
37
|
+
}
|