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,184 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
import { Button } from "@/components/ui/button";
|
|
4
|
+
import {
|
|
5
|
+
AlertDialog,
|
|
6
|
+
AlertDialogAction,
|
|
7
|
+
AlertDialogCancel,
|
|
8
|
+
AlertDialogContent,
|
|
9
|
+
AlertDialogDescription,
|
|
10
|
+
AlertDialogFooter,
|
|
11
|
+
AlertDialogHeader,
|
|
12
|
+
AlertDialogTitle,
|
|
13
|
+
} from "@/components/ui/alert-dialog";
|
|
14
|
+
import { Badge } from "@/components/ui/badge";
|
|
15
|
+
import { Sparkles, Loader2 } from "lucide-react";
|
|
16
|
+
import { apiRequest, queryClient } from "@/lib/queryClient";
|
|
17
|
+
import { useToast } from "@/hooks/use-toast";
|
|
18
|
+
import type { AutoOptimizeResult } from "@shared/schema";
|
|
19
|
+
|
|
20
|
+
interface AutoOptimizeButtonProps {
|
|
21
|
+
lineItemId: string;
|
|
22
|
+
lineItemName: string;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
variant?: "default" | "outline" | "ghost";
|
|
25
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function AutoOptimizeButton({
|
|
29
|
+
lineItemId,
|
|
30
|
+
lineItemName,
|
|
31
|
+
disabled = false,
|
|
32
|
+
variant = "outline",
|
|
33
|
+
size = "sm",
|
|
34
|
+
}: AutoOptimizeButtonProps) {
|
|
35
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
36
|
+
const [result, setResult] = useState<AutoOptimizeResult | null>(null);
|
|
37
|
+
const [resultOpen, setResultOpen] = useState(false);
|
|
38
|
+
const { toast } = useToast();
|
|
39
|
+
|
|
40
|
+
const autoOptimizeMutation = useMutation({
|
|
41
|
+
mutationFn: async (): Promise<AutoOptimizeResult> => {
|
|
42
|
+
const response = await apiRequest("POST", `/api/line-items/${lineItemId}/auto-optimize`, {
|
|
43
|
+
maxInventories: 5,
|
|
44
|
+
});
|
|
45
|
+
return response.json();
|
|
46
|
+
},
|
|
47
|
+
onSuccess: (data) => {
|
|
48
|
+
setConfirmOpen(false);
|
|
49
|
+
setResult(data);
|
|
50
|
+
setResultOpen(true);
|
|
51
|
+
queryClient.invalidateQueries({ queryKey: ["/api/line-items"] });
|
|
52
|
+
queryClient.invalidateQueries({ queryKey: ["/api/line-items", lineItemId] });
|
|
53
|
+
toast({
|
|
54
|
+
title: "Optimization Complete",
|
|
55
|
+
description: `Added ${data.summary.inventoriesAdded} recommended inventories`,
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
onError: (error: Error) => {
|
|
59
|
+
setConfirmOpen(false);
|
|
60
|
+
toast({
|
|
61
|
+
title: "Optimization Failed",
|
|
62
|
+
description: error.message,
|
|
63
|
+
variant: "destructive",
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const handleOptimize = () => {
|
|
69
|
+
autoOptimizeMutation.mutate();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
<Button
|
|
75
|
+
variant={variant}
|
|
76
|
+
size={size}
|
|
77
|
+
onClick={() => setConfirmOpen(true)}
|
|
78
|
+
disabled={disabled || autoOptimizeMutation.isPending}
|
|
79
|
+
data-testid={`button-auto-optimize-${lineItemId}`}
|
|
80
|
+
>
|
|
81
|
+
{autoOptimizeMutation.isPending ? (
|
|
82
|
+
<Loader2 className="h-4 w-4 animate-spin" />
|
|
83
|
+
) : (
|
|
84
|
+
<Sparkles className="h-4 w-4" />
|
|
85
|
+
)}
|
|
86
|
+
{size !== "icon" && <span className="ml-1">Auto-Optimize</span>}
|
|
87
|
+
</Button>
|
|
88
|
+
|
|
89
|
+
<AlertDialog open={confirmOpen} onOpenChange={setConfirmOpen}>
|
|
90
|
+
<AlertDialogContent>
|
|
91
|
+
<AlertDialogHeader>
|
|
92
|
+
<AlertDialogTitle className="flex items-center gap-2">
|
|
93
|
+
<Sparkles className="h-5 w-5 text-primary" />
|
|
94
|
+
Auto-Optimize Line Item
|
|
95
|
+
</AlertDialogTitle>
|
|
96
|
+
<AlertDialogDescription>
|
|
97
|
+
Use AI recommendations to automatically select the best-performing inventory for "{lineItemName}"?
|
|
98
|
+
<br /><br />
|
|
99
|
+
The system will analyze available inventory based on your campaign goals, budget, and targeting
|
|
100
|
+
to recommend the optimal screens.
|
|
101
|
+
</AlertDialogDescription>
|
|
102
|
+
</AlertDialogHeader>
|
|
103
|
+
<AlertDialogFooter>
|
|
104
|
+
<AlertDialogCancel disabled={autoOptimizeMutation.isPending} data-testid="button-cancel-optimize">
|
|
105
|
+
Cancel
|
|
106
|
+
</AlertDialogCancel>
|
|
107
|
+
<AlertDialogAction
|
|
108
|
+
onClick={(e) => {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
handleOptimize();
|
|
111
|
+
}}
|
|
112
|
+
disabled={autoOptimizeMutation.isPending}
|
|
113
|
+
data-testid="button-confirm-optimize"
|
|
114
|
+
>
|
|
115
|
+
{autoOptimizeMutation.isPending ? (
|
|
116
|
+
<>
|
|
117
|
+
<Loader2 className="h-4 w-4 mr-2 animate-spin" />
|
|
118
|
+
Optimizing...
|
|
119
|
+
</>
|
|
120
|
+
) : (
|
|
121
|
+
<>
|
|
122
|
+
<Sparkles className="h-4 w-4 mr-2" />
|
|
123
|
+
Optimize Now
|
|
124
|
+
</>
|
|
125
|
+
)}
|
|
126
|
+
</AlertDialogAction>
|
|
127
|
+
</AlertDialogFooter>
|
|
128
|
+
</AlertDialogContent>
|
|
129
|
+
</AlertDialog>
|
|
130
|
+
|
|
131
|
+
<AlertDialog open={resultOpen} onOpenChange={setResultOpen}>
|
|
132
|
+
<AlertDialogContent className="max-w-md">
|
|
133
|
+
<AlertDialogHeader>
|
|
134
|
+
<AlertDialogTitle className="flex items-center gap-2 text-green-600">
|
|
135
|
+
<Sparkles className="h-5 w-5" />
|
|
136
|
+
Optimization Complete
|
|
137
|
+
</AlertDialogTitle>
|
|
138
|
+
<AlertDialogDescription asChild>
|
|
139
|
+
<div className="space-y-4">
|
|
140
|
+
<p>AI recommendations have been applied to your line item.</p>
|
|
141
|
+
|
|
142
|
+
{result && (
|
|
143
|
+
<div className="bg-muted p-4 rounded-lg space-y-3">
|
|
144
|
+
<div className="flex justify-between items-center">
|
|
145
|
+
<span className="text-sm text-muted-foreground">Inventories Added</span>
|
|
146
|
+
<Badge variant="secondary">{result.summary.inventoriesAdded}</Badge>
|
|
147
|
+
</div>
|
|
148
|
+
<div className="flex justify-between items-center">
|
|
149
|
+
<span className="text-sm text-muted-foreground">Est. Impressions</span>
|
|
150
|
+
<span className="font-medium">{(result.summary.estimatedImpressions / 1000).toFixed(0)}K</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div className="flex justify-between items-center">
|
|
153
|
+
<span className="text-sm text-muted-foreground">Est. Cost</span>
|
|
154
|
+
<span className="font-medium">${result.summary.estimatedCost.toFixed(2)}</span>
|
|
155
|
+
</div>
|
|
156
|
+
{result.summary.budgetRemaining > 0 && (
|
|
157
|
+
<div className="flex justify-between items-center border-t pt-2">
|
|
158
|
+
<span className="text-sm text-muted-foreground">Budget Remaining</span>
|
|
159
|
+
<span className="font-medium text-green-600">${result.summary.budgetRemaining.toFixed(2)}</span>
|
|
160
|
+
</div>
|
|
161
|
+
)}
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
{result?.warnings && result.warnings.length > 0 && (
|
|
166
|
+
<div className="text-sm text-amber-600">
|
|
167
|
+
{result.warnings.map((w, i) => (
|
|
168
|
+
<p key={i}>{w}</p>
|
|
169
|
+
))}
|
|
170
|
+
</div>
|
|
171
|
+
)}
|
|
172
|
+
</div>
|
|
173
|
+
</AlertDialogDescription>
|
|
174
|
+
</AlertDialogHeader>
|
|
175
|
+
<AlertDialogFooter>
|
|
176
|
+
<AlertDialogAction data-testid="button-close-result">
|
|
177
|
+
Done
|
|
178
|
+
</AlertDialogAction>
|
|
179
|
+
</AlertDialogFooter>
|
|
180
|
+
</AlertDialogContent>
|
|
181
|
+
</AlertDialog>
|
|
182
|
+
</>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { useState, useMemo, useRef } from "react";
|
|
2
|
+
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "@/components/ui/sheet";
|
|
3
|
+
import { Button } from "@/components/ui/button";
|
|
4
|
+
import { ScrollArea } from "@/components/ui/scroll-area";
|
|
5
|
+
import { Input } from "@/components/ui/input";
|
|
6
|
+
import {
|
|
7
|
+
Search,
|
|
8
|
+
Monitor,
|
|
9
|
+
ZoomIn,
|
|
10
|
+
ZoomOut,
|
|
11
|
+
ChevronLeft,
|
|
12
|
+
ChevronRight,
|
|
13
|
+
Calendar,
|
|
14
|
+
Inbox
|
|
15
|
+
} from "lucide-react";
|
|
16
|
+
import { format, addMonths, startOfMonth, endOfMonth, eachMonthOfInterval, differenceInDays, addDays, parseISO } from "date-fns";
|
|
17
|
+
import type { Screen } from "@shared/schema";
|
|
18
|
+
|
|
19
|
+
type AvailabilityStatus = "available" | "booked" | "hold" | "maintenance" | "pending" | "unavailable";
|
|
20
|
+
|
|
21
|
+
interface Booking {
|
|
22
|
+
id: string;
|
|
23
|
+
screenId: string;
|
|
24
|
+
advertiser: string;
|
|
25
|
+
startDate: string;
|
|
26
|
+
endDate: string;
|
|
27
|
+
status: AvailabilityStatus;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface AvailabilityDrawerProps {
|
|
31
|
+
open: boolean;
|
|
32
|
+
onOpenChange: (open: boolean) => void;
|
|
33
|
+
screens: Screen[];
|
|
34
|
+
selectedScreenIds: string[];
|
|
35
|
+
lineItemStartDate?: string;
|
|
36
|
+
lineItemEndDate?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const STATUS_COLORS: Record<AvailabilityStatus, string> = {
|
|
40
|
+
available: "bg-green-500",
|
|
41
|
+
booked: "bg-red-500",
|
|
42
|
+
hold: "bg-amber-500",
|
|
43
|
+
maintenance: "bg-gray-500",
|
|
44
|
+
pending: "bg-blue-500",
|
|
45
|
+
unavailable: "bg-gray-400",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const ADVERTISERS = ["BMW", "Apple", "Nike", "Samsung", "Coca-Cola", "Netflix", "Microsoft", "Tudor", "Ray-Ban", "Americana"];
|
|
49
|
+
|
|
50
|
+
function seededRandom(seed: string, index: number): number {
|
|
51
|
+
let hash = 0;
|
|
52
|
+
const fullSeed = seed + index.toString();
|
|
53
|
+
for (let i = 0; i < fullSeed.length; i++) {
|
|
54
|
+
const char = fullSeed.charCodeAt(i);
|
|
55
|
+
hash = ((hash << 5) - hash) + char;
|
|
56
|
+
hash = hash & hash;
|
|
57
|
+
}
|
|
58
|
+
return Math.abs(hash % 100) / 100;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function generateMockBookings(screenIds: string[]): Booking[] {
|
|
62
|
+
const bookings: Booking[] = [];
|
|
63
|
+
const today = new Date();
|
|
64
|
+
|
|
65
|
+
screenIds.forEach((screenId, screenIndex) => {
|
|
66
|
+
const numBookings = Math.floor(seededRandom(screenId, 0) * 6) + 2;
|
|
67
|
+
let currentDate = addMonths(today, -1);
|
|
68
|
+
|
|
69
|
+
for (let i = 0; i < numBookings; i++) {
|
|
70
|
+
const gapDays = Math.floor(seededRandom(screenId, i * 3 + 1) * 20) + 5;
|
|
71
|
+
const durationDays = Math.floor(seededRandom(screenId, i * 3 + 2) * 45) + 7;
|
|
72
|
+
const startDate = addDays(currentDate, gapDays);
|
|
73
|
+
const endDate = addDays(startDate, durationDays);
|
|
74
|
+
|
|
75
|
+
const statusRand = seededRandom(screenId, i * 3 + 3);
|
|
76
|
+
let status: AvailabilityStatus;
|
|
77
|
+
if (statusRand < 0.7) status = "booked";
|
|
78
|
+
else if (statusRand < 0.85) status = "hold";
|
|
79
|
+
else if (statusRand < 0.95) status = "pending";
|
|
80
|
+
else status = "maintenance";
|
|
81
|
+
|
|
82
|
+
bookings.push({
|
|
83
|
+
id: `booking-${screenId}-${i}`,
|
|
84
|
+
screenId,
|
|
85
|
+
advertiser: ADVERTISERS[(screenIndex + i) % ADVERTISERS.length],
|
|
86
|
+
startDate: format(startDate, "yyyy-MM-dd"),
|
|
87
|
+
endDate: format(endDate, "yyyy-MM-dd"),
|
|
88
|
+
status,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
currentDate = endDate;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return bookings;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function AvailabilityDrawer({
|
|
99
|
+
open,
|
|
100
|
+
onOpenChange,
|
|
101
|
+
screens,
|
|
102
|
+
selectedScreenIds,
|
|
103
|
+
lineItemStartDate,
|
|
104
|
+
lineItemEndDate,
|
|
105
|
+
}: AvailabilityDrawerProps) {
|
|
106
|
+
const [search, setSearch] = useState("");
|
|
107
|
+
const [viewMode, setViewMode] = useState<"month" | "week">("month");
|
|
108
|
+
const [zoomLevel, setZoomLevel] = useState(1);
|
|
109
|
+
const [startMonth, setStartMonth] = useState(() => startOfMonth(new Date()));
|
|
110
|
+
const timelineRef = useRef<HTMLDivElement>(null);
|
|
111
|
+
|
|
112
|
+
const selectedScreens = useMemo(() => {
|
|
113
|
+
return screens.filter(s => selectedScreenIds.includes(s.id));
|
|
114
|
+
}, [screens, selectedScreenIds]);
|
|
115
|
+
|
|
116
|
+
const filteredScreens = useMemo(() => {
|
|
117
|
+
if (!search) return selectedScreens;
|
|
118
|
+
const lowerSearch = search.toLowerCase();
|
|
119
|
+
return selectedScreens.filter(s =>
|
|
120
|
+
s.name.toLowerCase().includes(lowerSearch) ||
|
|
121
|
+
s.city?.toLowerCase().includes(lowerSearch)
|
|
122
|
+
);
|
|
123
|
+
}, [selectedScreens, search]);
|
|
124
|
+
|
|
125
|
+
const bookings = useMemo(() => {
|
|
126
|
+
return generateMockBookings(selectedScreenIds);
|
|
127
|
+
}, [selectedScreenIds]);
|
|
128
|
+
|
|
129
|
+
const months = useMemo(() => {
|
|
130
|
+
const monthCount = viewMode === "month" ? 12 : 3;
|
|
131
|
+
return eachMonthOfInterval({
|
|
132
|
+
start: startMonth,
|
|
133
|
+
end: addMonths(startMonth, monthCount - 1),
|
|
134
|
+
});
|
|
135
|
+
}, [startMonth, viewMode]);
|
|
136
|
+
|
|
137
|
+
const totalDays = useMemo(() => {
|
|
138
|
+
return differenceInDays(endOfMonth(months[months.length - 1]), startMonth) + 1;
|
|
139
|
+
}, [months, startMonth]);
|
|
140
|
+
|
|
141
|
+
const dayWidth = viewMode === "month" ? 3 * zoomLevel : 12 * zoomLevel;
|
|
142
|
+
const timelineWidth = totalDays * dayWidth;
|
|
143
|
+
|
|
144
|
+
const getBookingPosition = (booking: Booking) => {
|
|
145
|
+
const bookingStart = parseISO(booking.startDate);
|
|
146
|
+
const bookingEnd = parseISO(booking.endDate);
|
|
147
|
+
const timelineStart = startMonth;
|
|
148
|
+
const timelineEnd = endOfMonth(months[months.length - 1]);
|
|
149
|
+
|
|
150
|
+
if (bookingEnd < timelineStart || bookingStart > timelineEnd) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const effectiveStart = bookingStart < timelineStart ? timelineStart : bookingStart;
|
|
155
|
+
const effectiveEnd = bookingEnd > timelineEnd ? timelineEnd : bookingEnd;
|
|
156
|
+
|
|
157
|
+
const startOffset = differenceInDays(effectiveStart, timelineStart);
|
|
158
|
+
const duration = differenceInDays(effectiveEnd, effectiveStart) + 1;
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
left: startOffset * dayWidth,
|
|
162
|
+
width: Math.max(duration * dayWidth - 2, dayWidth),
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const navigatePrev = () => {
|
|
167
|
+
setStartMonth(prev => addMonths(prev, viewMode === "month" ? -6 : -1));
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const navigateNext = () => {
|
|
171
|
+
setStartMonth(prev => addMonths(prev, viewMode === "month" ? 6 : 1));
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
176
|
+
<SheetContent side="right" className="w-full sm:max-w-[90vw] p-0 flex flex-col">
|
|
177
|
+
<SheetHeader className="p-4 border-b shrink-0">
|
|
178
|
+
<div className="flex items-center justify-between">
|
|
179
|
+
<SheetTitle className="flex items-center gap-2">
|
|
180
|
+
<Calendar className="h-5 w-5" />
|
|
181
|
+
Inventory Availability
|
|
182
|
+
</SheetTitle>
|
|
183
|
+
<div className="flex items-center gap-2">
|
|
184
|
+
<Button
|
|
185
|
+
variant={viewMode === "month" ? "default" : "outline"}
|
|
186
|
+
size="sm"
|
|
187
|
+
onClick={() => setViewMode("month")}
|
|
188
|
+
data-testid="button-view-month"
|
|
189
|
+
>
|
|
190
|
+
Month
|
|
191
|
+
</Button>
|
|
192
|
+
<Button
|
|
193
|
+
variant={viewMode === "week" ? "default" : "outline"}
|
|
194
|
+
size="sm"
|
|
195
|
+
onClick={() => setViewMode("week")}
|
|
196
|
+
data-testid="button-view-week"
|
|
197
|
+
>
|
|
198
|
+
Week
|
|
199
|
+
</Button>
|
|
200
|
+
<div className="h-4 w-px bg-border mx-1" />
|
|
201
|
+
<Button
|
|
202
|
+
variant="ghost"
|
|
203
|
+
size="icon"
|
|
204
|
+
onClick={() => setZoomLevel(z => Math.max(0.5, z - 0.25))}
|
|
205
|
+
data-testid="button-zoom-out"
|
|
206
|
+
>
|
|
207
|
+
<ZoomOut className="h-4 w-4" />
|
|
208
|
+
</Button>
|
|
209
|
+
<Button
|
|
210
|
+
variant="ghost"
|
|
211
|
+
size="icon"
|
|
212
|
+
onClick={() => setZoomLevel(z => Math.min(2, z + 0.25))}
|
|
213
|
+
data-testid="button-zoom-in"
|
|
214
|
+
>
|
|
215
|
+
<ZoomIn className="h-4 w-4" />
|
|
216
|
+
</Button>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</SheetHeader>
|
|
220
|
+
|
|
221
|
+
<div className="p-4 border-b shrink-0">
|
|
222
|
+
<div className="flex items-center gap-4">
|
|
223
|
+
<div className="relative flex-1 max-w-xs">
|
|
224
|
+
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
225
|
+
<Input
|
|
226
|
+
placeholder="Search screens..."
|
|
227
|
+
value={search}
|
|
228
|
+
onChange={(e) => setSearch(e.target.value)}
|
|
229
|
+
className="pl-9"
|
|
230
|
+
data-testid="input-search-screens"
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
<div className="flex items-center gap-2">
|
|
234
|
+
<Button variant="ghost" size="icon" onClick={navigatePrev}>
|
|
235
|
+
<ChevronLeft className="h-4 w-4" />
|
|
236
|
+
</Button>
|
|
237
|
+
<span className="text-sm font-medium min-w-[120px] text-center">
|
|
238
|
+
{format(startMonth, "MMM yyyy")}
|
|
239
|
+
</span>
|
|
240
|
+
<Button variant="ghost" size="icon" onClick={navigateNext}>
|
|
241
|
+
<ChevronRight className="h-4 w-4" />
|
|
242
|
+
</Button>
|
|
243
|
+
</div>
|
|
244
|
+
<div className="text-sm text-muted-foreground">
|
|
245
|
+
{filteredScreens.length} screen{filteredScreens.length !== 1 ? 's' : ''}
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
|
|
250
|
+
<div className="flex-1 flex overflow-hidden">
|
|
251
|
+
<div className="w-64 border-r shrink-0 flex flex-col">
|
|
252
|
+
<div className="h-10 border-b bg-muted/30 px-3 flex items-center">
|
|
253
|
+
<span className="text-xs font-medium text-muted-foreground">Inventory</span>
|
|
254
|
+
</div>
|
|
255
|
+
<ScrollArea className="flex-1">
|
|
256
|
+
{filteredScreens.length === 0 ? (
|
|
257
|
+
<div className="flex flex-col items-center justify-center py-12 px-4 text-center">
|
|
258
|
+
<Inbox className="h-8 w-8 text-muted-foreground mb-2" />
|
|
259
|
+
<p className="text-sm text-muted-foreground">
|
|
260
|
+
{search ? "No screens match your search" : "No screens selected"}
|
|
261
|
+
</p>
|
|
262
|
+
</div>
|
|
263
|
+
) : (
|
|
264
|
+
<div className="divide-y">
|
|
265
|
+
{filteredScreens.map((screen) => (
|
|
266
|
+
<div
|
|
267
|
+
key={screen.id}
|
|
268
|
+
className="px-3 py-2 hover-elevate cursor-pointer"
|
|
269
|
+
data-testid={`row-screen-${screen.id}`}
|
|
270
|
+
>
|
|
271
|
+
<div className="flex items-center gap-2">
|
|
272
|
+
<Monitor className="h-4 w-4 text-muted-foreground shrink-0" />
|
|
273
|
+
<div className="min-w-0">
|
|
274
|
+
<div className="text-sm font-medium truncate">{screen.name}</div>
|
|
275
|
+
<div className="text-xs text-muted-foreground truncate">
|
|
276
|
+
{screen.city}
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
))}
|
|
282
|
+
</div>
|
|
283
|
+
)}
|
|
284
|
+
</ScrollArea>
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<div className="flex-1 overflow-auto" ref={timelineRef}>
|
|
288
|
+
<div style={{ minWidth: timelineWidth + 20 }}>
|
|
289
|
+
<div className="h-10 border-b bg-muted/30 flex sticky top-0 z-10">
|
|
290
|
+
{months.map((month) => {
|
|
291
|
+
const daysInMonth = differenceInDays(endOfMonth(month), month) + 1;
|
|
292
|
+
const monthWidth = daysInMonth * dayWidth;
|
|
293
|
+
return (
|
|
294
|
+
<div
|
|
295
|
+
key={month.toISOString()}
|
|
296
|
+
className="border-r text-xs font-medium text-muted-foreground flex items-center justify-center"
|
|
297
|
+
style={{ width: monthWidth }}
|
|
298
|
+
>
|
|
299
|
+
{format(month, "MMM yy")}
|
|
300
|
+
</div>
|
|
301
|
+
);
|
|
302
|
+
})}
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<div className="divide-y">
|
|
306
|
+
{filteredScreens.map((screen) => {
|
|
307
|
+
const screenBookings = bookings.filter(b => b.screenId === screen.id);
|
|
308
|
+
return (
|
|
309
|
+
<div
|
|
310
|
+
key={screen.id}
|
|
311
|
+
className="h-10 relative bg-muted/10"
|
|
312
|
+
style={{ width: timelineWidth }}
|
|
313
|
+
>
|
|
314
|
+
{lineItemStartDate && lineItemEndDate && (
|
|
315
|
+
<div
|
|
316
|
+
className="absolute top-0 bottom-0 bg-primary/10 border-l border-r border-primary/30"
|
|
317
|
+
style={{
|
|
318
|
+
left: Math.max(0, differenceInDays(parseISO(lineItemStartDate), startMonth)) * dayWidth,
|
|
319
|
+
width: (differenceInDays(parseISO(lineItemEndDate), parseISO(lineItemStartDate)) + 1) * dayWidth,
|
|
320
|
+
}}
|
|
321
|
+
/>
|
|
322
|
+
)}
|
|
323
|
+
|
|
324
|
+
{screenBookings.map((booking) => {
|
|
325
|
+
const pos = getBookingPosition(booking);
|
|
326
|
+
if (!pos) return null;
|
|
327
|
+
return (
|
|
328
|
+
<div
|
|
329
|
+
key={booking.id}
|
|
330
|
+
className={`absolute top-1 bottom-1 rounded text-[10px] text-white font-medium flex items-center justify-center overflow-hidden px-1 ${STATUS_COLORS[booking.status]}`}
|
|
331
|
+
style={{ left: pos.left, width: pos.width }}
|
|
332
|
+
title={`${booking.advertiser} - ${booking.status}`}
|
|
333
|
+
>
|
|
334
|
+
{pos.width > 40 && <span className="truncate">{booking.advertiser}</span>}
|
|
335
|
+
</div>
|
|
336
|
+
);
|
|
337
|
+
})}
|
|
338
|
+
</div>
|
|
339
|
+
);
|
|
340
|
+
})}
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<div className="p-4 border-t shrink-0 bg-muted/30">
|
|
347
|
+
<div className="flex items-center justify-between">
|
|
348
|
+
<div className="flex items-center gap-4">
|
|
349
|
+
<span className="text-xs text-muted-foreground">Availability Status:</span>
|
|
350
|
+
<div className="flex items-center gap-3">
|
|
351
|
+
<div className="flex items-center gap-1">
|
|
352
|
+
<span className="w-3 h-3 rounded bg-green-500" />
|
|
353
|
+
<span className="text-xs">Available</span>
|
|
354
|
+
</div>
|
|
355
|
+
<div className="flex items-center gap-1">
|
|
356
|
+
<span className="w-3 h-3 rounded bg-red-500" />
|
|
357
|
+
<span className="text-xs">Booked</span>
|
|
358
|
+
</div>
|
|
359
|
+
<div className="flex items-center gap-1">
|
|
360
|
+
<span className="w-3 h-3 rounded bg-amber-500" />
|
|
361
|
+
<span className="text-xs">Hold</span>
|
|
362
|
+
</div>
|
|
363
|
+
<div className="flex items-center gap-1">
|
|
364
|
+
<span className="w-3 h-3 rounded bg-gray-500" />
|
|
365
|
+
<span className="text-xs">Maintenance</span>
|
|
366
|
+
</div>
|
|
367
|
+
<div className="flex items-center gap-1">
|
|
368
|
+
<span className="w-3 h-3 rounded bg-blue-500" />
|
|
369
|
+
<span className="text-xs">Pending</span>
|
|
370
|
+
</div>
|
|
371
|
+
<div className="flex items-center gap-1">
|
|
372
|
+
<span className="w-3 h-3 rounded bg-gray-400" />
|
|
373
|
+
<span className="text-xs">Unavailable</span>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
</div>
|
|
377
|
+
<div className="text-xs text-muted-foreground">
|
|
378
|
+
Ctrl + Scroll to zoom
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
</SheetContent>
|
|
383
|
+
</Sheet>
|
|
384
|
+
);
|
|
385
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Tag } from "lucide-react";
|
|
2
|
+
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
3
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
|
4
|
+
import { Badge } from "@/components/ui/badge";
|
|
5
|
+
import type { Brand } from "@shared/schema";
|
|
6
|
+
|
|
7
|
+
const IAB_CATEGORY_CODES: Record<string, string> = {
|
|
8
|
+
"Automotive": "IAB2",
|
|
9
|
+
"Business": "IAB3",
|
|
10
|
+
"Careers": "IAB4",
|
|
11
|
+
"Education": "IAB5",
|
|
12
|
+
"Family & Parenting": "IAB6",
|
|
13
|
+
"Health & Fitness": "IAB7",
|
|
14
|
+
"Food & Drink": "IAB8",
|
|
15
|
+
"Hobbies & Interests": "IAB9",
|
|
16
|
+
"Home & Garden": "IAB10",
|
|
17
|
+
"Law, Gov't & Politics": "IAB11",
|
|
18
|
+
"News": "IAB12",
|
|
19
|
+
"Personal Finance": "IAB13",
|
|
20
|
+
"Society": "IAB14",
|
|
21
|
+
"Science": "IAB15",
|
|
22
|
+
"Pets": "IAB16",
|
|
23
|
+
"Sports": "IAB17",
|
|
24
|
+
"Style & Fashion": "IAB18",
|
|
25
|
+
"Technology & Computing": "IAB19",
|
|
26
|
+
"Travel": "IAB20",
|
|
27
|
+
"Real Estate": "IAB21",
|
|
28
|
+
"Shopping": "IAB22",
|
|
29
|
+
"Religion & Spirituality": "IAB23",
|
|
30
|
+
"Uncategorized": "IAB24",
|
|
31
|
+
"Non-Standard Content": "IAB25",
|
|
32
|
+
"Illegal Content": "IAB26",
|
|
33
|
+
"Television": "IAB1",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
interface BrandInsightsPanelProps {
|
|
37
|
+
brand: Brand | null | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function BrandInsightsPanel({ brand }: BrandInsightsPanelProps) {
|
|
41
|
+
if (!brand) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const iabCode = brand.iabCategory ? IAB_CATEGORY_CODES[brand.iabCategory] || "IAB24" : "IAB24";
|
|
46
|
+
const category = brand.iabCategory || "Uncategorized";
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Card data-testid="panel-brand-insights">
|
|
50
|
+
<CardHeader className="pb-3">
|
|
51
|
+
<CardTitle className="text-sm font-medium flex items-center gap-2" data-testid="title-brand-insights">
|
|
52
|
+
<Tag className="h-4 w-4 text-blue-500" />
|
|
53
|
+
Brand Selected
|
|
54
|
+
</CardTitle>
|
|
55
|
+
</CardHeader>
|
|
56
|
+
<CardContent className="pt-0">
|
|
57
|
+
<div className="space-y-4">
|
|
58
|
+
<div className="flex items-center gap-4 p-3 rounded-lg bg-muted/50">
|
|
59
|
+
<Avatar className="h-14 w-14 rounded-lg">
|
|
60
|
+
{brand.logoUrl ? (
|
|
61
|
+
<AvatarImage src={brand.logoUrl} alt={brand.name} />
|
|
62
|
+
) : null}
|
|
63
|
+
<AvatarFallback className="rounded-lg bg-gradient-to-br from-blue-500 to-blue-600 text-white text-xl font-bold">
|
|
64
|
+
{brand.name.charAt(0)}
|
|
65
|
+
</AvatarFallback>
|
|
66
|
+
</Avatar>
|
|
67
|
+
<div className="flex-1 min-w-0">
|
|
68
|
+
<div className="font-semibold text-base truncate" data-testid="text-brand-name">{brand.name}</div>
|
|
69
|
+
<div className="flex items-center gap-2 mt-1">
|
|
70
|
+
<Badge variant="secondary" className="text-xs" data-testid="text-brand-category">
|
|
71
|
+
{category}
|
|
72
|
+
</Badge>
|
|
73
|
+
<Badge variant="outline" className="text-xs font-mono" data-testid="text-brand-iab-code">
|
|
74
|
+
{iabCode}
|
|
75
|
+
</Badge>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div className="text-sm text-muted-foreground p-2 rounded bg-blue-50 dark:bg-blue-950/30 border border-blue-100 dark:border-blue-900" data-testid="text-brand-insight-recommendation">
|
|
81
|
+
Brand selection helps with better targeting and inventory recommendations
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</CardContent>
|
|
85
|
+
</Card>
|
|
86
|
+
);
|
|
87
|
+
}
|