@manta-eu/react 0.1.0 → 0.1.1

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.
Files changed (109) hide show
  1. package/README.md +101 -35
  2. package/dist/components/channel-icon/index.d.ts +1 -2
  3. package/dist/components/channel-icon/index.d.ts.map +1 -1
  4. package/dist/components/channel-icon/index.js +0 -4
  5. package/dist/components/plan-row/index.d.ts +2 -1
  6. package/dist/components/plan-row/index.d.ts.map +1 -1
  7. package/dist/components/plan-row/index.js +2 -14
  8. package/dist/globals.css +146 -90
  9. package/dist/graph/nodes/AdMockupCard.js +1 -1
  10. package/dist/graph/nodes/CreativeMediaCard.js +1 -1
  11. package/dist/graph/nodes/EntityCardShell.js +1 -1
  12. package/dist/hooks/use-conversation-starters.d.ts +1 -1
  13. package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
  14. package/dist/routes/memories/components/ChangeScopeDialog.d.ts +12 -0
  15. package/dist/routes/memories/components/ChangeScopeDialog.d.ts.map +1 -0
  16. package/dist/routes/memories/components/ChangeScopeDialog.js +89 -0
  17. package/dist/routes/memories/components/ConflictMemoryCard.d.ts +13 -0
  18. package/dist/routes/memories/components/ConflictMemoryCard.d.ts.map +1 -0
  19. package/dist/routes/memories/components/ConflictMemoryCard.js +43 -0
  20. package/dist/routes/memories/components/ConflictTimeoutFooter.d.ts +7 -0
  21. package/dist/routes/memories/components/ConflictTimeoutFooter.d.ts.map +1 -0
  22. package/dist/routes/memories/components/ConflictTimeoutFooter.js +6 -0
  23. package/dist/routes/memories/components/ConsolidationReviewDialog.d.ts +61 -0
  24. package/dist/routes/memories/components/ConsolidationReviewDialog.d.ts.map +1 -0
  25. package/dist/routes/memories/components/ConsolidationReviewDialog.js +121 -0
  26. package/dist/routes/memories/components/EmptyStates.d.ts +18 -0
  27. package/dist/routes/memories/components/EmptyStates.d.ts.map +1 -0
  28. package/dist/routes/memories/components/EmptyStates.js +22 -0
  29. package/dist/routes/memories/components/ImportanceSlider.d.ts +11 -0
  30. package/dist/routes/memories/components/ImportanceSlider.d.ts.map +1 -0
  31. package/dist/routes/memories/components/ImportanceSlider.js +31 -0
  32. package/dist/routes/memories/components/LiveContextTab.d.ts +6 -0
  33. package/dist/routes/memories/components/LiveContextTab.d.ts.map +1 -0
  34. package/dist/routes/memories/components/LiveContextTab.js +37 -0
  35. package/dist/routes/memories/components/LoadingSkeleton.d.ts +2 -0
  36. package/dist/routes/memories/components/LoadingSkeleton.d.ts.map +1 -0
  37. package/dist/routes/memories/components/LoadingSkeleton.js +7 -0
  38. package/dist/routes/memories/components/MemoriesFilters.d.ts +31 -0
  39. package/dist/routes/memories/components/MemoriesFilters.d.ts.map +1 -0
  40. package/dist/routes/memories/components/MemoriesFilters.js +88 -0
  41. package/dist/routes/memories/components/MemoriesPanel.d.ts +6 -0
  42. package/dist/routes/memories/components/MemoriesPanel.d.ts.map +1 -0
  43. package/dist/routes/memories/components/MemoriesPanel.js +99 -0
  44. package/dist/routes/memories/components/MemoriesTabPanel.d.ts +30 -0
  45. package/dist/routes/memories/components/MemoriesTabPanel.d.ts.map +1 -0
  46. package/dist/routes/memories/components/MemoriesTabPanel.js +11 -0
  47. package/dist/routes/memories/components/MemoryActions.d.ts +12 -0
  48. package/dist/routes/memories/components/MemoryActions.d.ts.map +1 -0
  49. package/dist/routes/memories/components/MemoryActions.js +24 -0
  50. package/dist/routes/memories/components/MemoryFields.d.ts +32 -0
  51. package/dist/routes/memories/components/MemoryFields.d.ts.map +1 -0
  52. package/dist/routes/memories/components/MemoryFields.js +30 -0
  53. package/dist/routes/memories/components/MemoryFormDialog.d.ts +15 -0
  54. package/dist/routes/memories/components/MemoryFormDialog.d.ts.map +1 -0
  55. package/dist/routes/memories/components/MemoryFormDialog.js +299 -0
  56. package/dist/routes/memories/components/MemoryOnboardingWizard.d.ts +9 -0
  57. package/dist/routes/memories/components/MemoryOnboardingWizard.d.ts.map +1 -0
  58. package/dist/routes/memories/components/MemoryOnboardingWizard.js +99 -0
  59. package/dist/routes/memories/components/RestoreBlockedDialog.d.ts +8 -0
  60. package/dist/routes/memories/components/RestoreBlockedDialog.d.ts.map +1 -0
  61. package/dist/routes/memories/components/RestoreBlockedDialog.js +7 -0
  62. package/dist/routes/memories/components/SchemasTab.d.ts +6 -0
  63. package/dist/routes/memories/components/SchemasTab.d.ts.map +1 -0
  64. package/dist/routes/memories/components/SchemasTab.js +35 -0
  65. package/dist/routes/memories/components/SupersessionConflictDialog.d.ts +18 -0
  66. package/dist/routes/memories/components/SupersessionConflictDialog.d.ts.map +1 -0
  67. package/dist/routes/memories/components/SupersessionConflictDialog.js +78 -0
  68. package/dist/routes/memories/components/TeamPicker.d.ts +8 -0
  69. package/dist/routes/memories/components/TeamPicker.d.ts.map +1 -0
  70. package/dist/routes/memories/components/TeamPicker.js +25 -0
  71. package/dist/routes/memories/components/badges.d.ts +50 -0
  72. package/dist/routes/memories/components/badges.d.ts.map +1 -0
  73. package/dist/routes/memories/components/badges.js +106 -0
  74. package/dist/routes/memories/expiry-utils.d.ts +23 -0
  75. package/dist/routes/memories/expiry-utils.d.ts.map +1 -0
  76. package/dist/routes/memories/expiry-utils.js +97 -0
  77. package/dist/routes/memories/hooks/useConflictCheck.d.ts +18 -0
  78. package/dist/routes/memories/hooks/useConflictCheck.d.ts.map +1 -0
  79. package/dist/routes/memories/hooks/useConflictCheck.js +35 -0
  80. package/dist/routes/memories/hooks/useDuplicateDetection.d.ts +11 -0
  81. package/dist/routes/memories/hooks/useDuplicateDetection.d.ts.map +1 -0
  82. package/dist/routes/memories/hooks/useDuplicateDetection.js +73 -0
  83. package/dist/routes/memories/hooks/useLiveContext.d.ts +23 -0
  84. package/dist/routes/memories/hooks/useLiveContext.d.ts.map +1 -0
  85. package/dist/routes/memories/hooks/useLiveContext.js +102 -0
  86. package/dist/routes/memories/hooks/useMemoryColumns.d.ts +33 -0
  87. package/dist/routes/memories/hooks/useMemoryColumns.d.ts.map +1 -0
  88. package/dist/routes/memories/hooks/useMemoryColumns.js +188 -0
  89. package/dist/routes/memories/hooks/useMemoryTable.d.ts +33 -0
  90. package/dist/routes/memories/hooks/useMemoryTable.d.ts.map +1 -0
  91. package/dist/routes/memories/hooks/useMemoryTable.js +121 -0
  92. package/dist/routes/memories/index.d.ts +11 -0
  93. package/dist/routes/memories/index.d.ts.map +1 -0
  94. package/dist/routes/memories/index.js +472 -0
  95. package/dist/routes/memories/memory-form-validation.d.ts +8 -0
  96. package/dist/routes/memories/memory-form-validation.d.ts.map +1 -0
  97. package/dist/routes/memories/memory-form-validation.js +33 -0
  98. package/dist/routes/memories/memory-mutation-input.d.ts +6 -0
  99. package/dist/routes/memories/memory-mutation-input.d.ts.map +1 -0
  100. package/dist/routes/memories/memory-mutation-input.js +41 -0
  101. package/dist/routes/plans/components/actionPlansTableConfig.d.ts +3 -3
  102. package/package.json +12 -7
  103. package/src/globals.css +13 -18
  104. package/src/themes/manta-dark.css +0 -4
  105. package/src/themes/standard.css +11 -11
  106. package/dist/components/channel-icon/marketer-icon.d.ts +0 -4
  107. package/dist/components/channel-icon/marketer-icon.d.ts.map +0 -1
  108. package/dist/components/channel-icon/marketer-icon.js +0 -6
  109. package/src/themes/marketer-dark.css +0 -70
package/README.md CHANGED
@@ -1,39 +1,48 @@
1
1
  # @manta-eu/react
2
2
 
3
- Shared React components and design system styles for Marketer apps.
3
+ React components and design system for Manta apps, including the copilot chat.
4
4
 
5
- ## Installation
5
+ ## Adding the copilot to a React app
6
6
 
7
- Install in your project:
7
+ Five steps, end to end. Steps 1–3 are setup you do once; step 4 generates the types your app queries
8
+ the graph with; step 5 is the chat itself.
9
+
10
+ ### 1. Install
8
11
 
9
12
  ```bash
10
- pnpm add @manta-eu/react
13
+ pnpm add @manta-eu/react @manta-eu/codegen
14
+ pnpm add react react-dom next-themes @xyflow/react html-to-image @ulb-darmstadt/shacl-form
15
+ pnpm add -D tailwindcss @tailwindcss/postcss # or @tailwindcss/vite, in a Vite app
11
16
  ```
12
17
 
13
- ### 1. Add base styles to your global CSS
18
+ The second line is this package's peer dependencies — the versions are yours to pick, so the
19
+ package does not pin them for you. `react` and `react-dom` must satisfy `^19.0.0`.
20
+
21
+ The third is Tailwind 4 and a build plugin for it. The package does not bring its own: the
22
+ stylesheet it ships opens with `@import "tailwindcss"`, so Tailwind has to resolve from your tree
23
+ whatever you write in step 2.
14
24
 
15
- In your app’s main stylesheet (e.g. `src/styles.css`), import Tailwind and the package styles:
25
+ ### 2. Add the styles
26
+
27
+ The copilot is styled with Tailwind 4, so your app has to process the package's CSS. In your global
28
+ stylesheet:
16
29
 
17
30
  ```css
18
31
  @import "tailwindcss";
19
32
 
20
- /* Marketer components – design tokens, base styles, utilities */
33
+ /* Manta components – design tokens, base styles, utilities */
21
34
  @import "@manta-eu/react/globals.css";
22
- ```
23
35
 
24
- ### 2. Include the package in Tailwind’s content (purge)
25
-
26
- So Tailwind keeps classes used by `@manta-eu/react` in the build, add `@source` in the same global CSS file, pointing at the package (adjust the path if your `node_modules` layout differs, e.g. in a monorepo):
27
-
28
- ```css
36
+ /* Keep the classes the package uses in your build */
29
37
  @source "../node_modules/@manta-eu/react/";
30
38
  ```
31
39
 
32
- If the package is hoisted (e.g. at the repo root), the path might be `../../node_modules/@manta-eu/react/`.
40
+ Adjust the `@source` path if your `node_modules` sits elsewhere — in a monorepo it is often
41
+ `../../node_modules/@manta-eu/react/`.
33
42
 
34
- ### 3. Override the font variable
43
+ ### 3. Point the font variable at a real font
35
44
 
36
- The design system expects `--font-roobertpro` to be set to your actual font. Override it in your global CSS, for example in `@theme` and/or `:root`:
45
+ The design system reads `--font-roobertpro`. Set it to whatever you actually load:
37
46
 
38
47
  ```css
39
48
  @theme {
@@ -45,11 +54,78 @@ The design system expects `--font-roobertpro` to be set to your actual font. Ove
45
54
  }
46
55
  ```
47
56
 
48
- Use your real font family name (and fallbacks) if it differs from `RoobertPro`.
57
+ ### 4. Generate the graph types
49
58
 
50
- ## Usage
59
+ The copilot reads a datastore whose shapes are specific to your deployment, so the types come from
60
+ that datastore rather than from this package. `@manta-eu/codegen` fetches them over HTTP:
51
61
 
52
- Import components and use the design system:
62
+ ```bash
63
+ pnpm manta-codegen generate \
64
+ --api-url https://app.hiremanta.com \
65
+ --datastore your-datastore \
66
+ --keycloak-url https://auth.hiremanta.com \
67
+ --keycloak-realm your-realm \
68
+ --client-id your-realm-app \
69
+ --out ./.ldkit
70
+ ```
71
+
72
+ The run writes one file per namespace plus an `index.ts` that re-exports them. Re-run it whenever
73
+ the shapes change. See [`@manta-eu/codegen`](https://www.npmjs.com/package/@manta-eu/codegen) for
74
+ the device-login and service-account paths.
75
+
76
+ ### 5. Mount the chat
77
+
78
+ `EmbeddedChatProviders` supplies the API client, query cache and graph state; `EmbeddedChat` is the
79
+ copilot itself. Requests carry the session from `mantaBaseUrl`, so the user signs in there.
80
+
81
+ ```tsx
82
+ import { EmbeddedChat } from "@manta-eu/react/components/embedded-chat";
83
+ import { EmbeddedChatProviders } from "@manta-eu/react/providers";
84
+ import "./globals.css";
85
+
86
+ export function Copilot() {
87
+ return (
88
+ <EmbeddedChatProviders mantaBaseUrl="https://app.hiremanta.com" datastoreId="your-datastore">
89
+ <EmbeddedChat
90
+ user={{ id: "…", email: "you@example.com", name: "You" }}
91
+ isOperator={false}
92
+ assistantName="Copilot"
93
+ />
94
+ </EmbeddedChatProviders>
95
+ );
96
+ }
97
+ ```
98
+
99
+ That is a working copilot. Everything below is optional.
100
+
101
+ ## Tailoring the chat
102
+
103
+ `EmbeddedChat` takes these, all optional unless marked:
104
+
105
+ | Prop | Type | What it does |
106
+ | ----------------------------- | ------------------------------------- | ------------------------------------------------- |
107
+ | `user` | `{ id, email, name? }` — **required** | Who is talking |
108
+ | `isOperator` | `boolean` — **required** | Unlocks operator-only affordances |
109
+ | `datastore` | `Datastore` | The datastore to read; defaults to the provider's |
110
+ | `datastores` | `Datastore[]` | Choices when `canSwitchDatastore` is set |
111
+ | `canSwitchDatastore` | `boolean` | Lets an operator change datastore in the UI |
112
+ | `title` | `string` | Header text |
113
+ | `assistantName` | `string` | What the assistant calls itself |
114
+ | `welcomeSubtitle` | `string` | Subtitle on the empty state |
115
+ | `initialPrompt` | `string` | Prefills the composer |
116
+ | `mark` | `ReactNode` | Your logo in the header |
117
+ | `allowedModels` | `MantaModelId[]` | Restricts the model picker |
118
+ | `pageContext` | `PageContext` | Tells the assistant what the user is looking at |
119
+ | `collapsible` / `isCollapsed` | `boolean` | Collapsed presentation |
120
+ | `onClose` / `onLogout` | `() => void` | Chrome callbacks |
121
+ | `onSelectPlan` | `(planIri: string) => void` | Fires when a plan is opened |
122
+ | `renderMenuItems` | `(defaults) => ReactNode[]` | Replaces the overflow menu |
123
+
124
+ Removing or renaming one of these is a breaking change, so they change rarely.
125
+
126
+ ## Using the components on their own
127
+
128
+ The design system is usable without the chat:
53
129
 
54
130
  ```tsx
55
131
  import { Button } from "@manta-eu/react/button";
@@ -60,28 +136,18 @@ export function App() {
60
136
  }
61
137
  ```
62
138
 
63
- Your app must use Tailwind 4 and process the package CSS (e.g. PostCSS with `@tailwindcss/postcss`) so the design tokens and utilities in `globals.css` apply.
139
+ Every component has its own subpath export — `@manta-eu/react/button`, `/avatar`, `/badge` and so
140
+ on — so you only pull in what you render.
64
141
 
65
142
  ## Themes
66
143
 
67
- Three themes are included: **standard** (default), **manta** (light), and **manta-dark**. Switch at runtime by setting a data attribute on `<html>`:
144
+ Three ship with the package: **standard** (default), **manta** (light) and **manta-dark**. Switch at
145
+ runtime on the document root:
68
146
 
69
147
  ```tsx
70
148
  document.documentElement.dataset.theme = "manta";
71
149
  ```
72
150
 
73
- Or use a React context/component that sets `data-theme` on the document root. Theme files live in `src/themes/` (standard.css, manta.css, manta-dark.css).
74
-
75
- ## Development
76
-
77
- ```bash
78
- pnpm storybook
79
- ```
80
-
81
- Runs Storybook on port 6007.
82
-
83
- ## Exports
151
+ ## License
84
152
 
85
- - `@manta-eu/react/button` – Button component
86
- - `@manta-eu/react/style` – `cn()` utility
87
- - `@manta-eu/react/globals.css` – Design system stylesheet
153
+ MIT
@@ -1,4 +1,4 @@
1
- export type Channel = "META" | "GOOGLE_ADS" | "SNAPCHAT" | "SHOPIFY" | "MARKETER" | "MANTA";
1
+ export type Channel = "META" | "GOOGLE_ADS" | "SNAPCHAT" | "SHOPIFY" | "MANTA";
2
2
  export type ChannelIconProps = {
3
3
  channel?: Channel;
4
4
  showName?: boolean;
@@ -12,5 +12,4 @@ export { GoogleAdsIcon } from "./google-ads-icon.js";
12
12
  export { SnapChatIcon } from "./snapchat-icon.js";
13
13
  export { ShopifyIcon } from "./shopify-icon.js";
14
14
  export { MantaIcon } from "./manta-icon.js";
15
- export { MarketerIcon } from "./marketer-icon.js";
16
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/channel-icon/index.tsx"],"names":[],"mappings":"AASA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAW5F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kDA0ClD;AAED,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/channel-icon/index.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAU/E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,kDAoClD;AAED,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { match } from "ts-pattern";
3
3
  import { GoogleAdsIcon } from "./google-ads-icon.js";
4
4
  import { MantaIcon } from "./manta-icon.js";
5
- import { MarketerIcon } from "./marketer-icon.js";
6
5
  import { MetaIcon } from "./meta-icon.js";
7
6
  import { ShopifyIcon } from "./shopify-icon.js";
8
7
  import { SnapChatIcon } from "./snapchat-icon.js";
@@ -12,7 +11,6 @@ const channelDisplayName = {
12
11
  GOOGLE_ADS: "Google Ads",
13
12
  SNAPCHAT: "Snapchat",
14
13
  SHOPIFY: "Shopify",
15
- MARKETER: "Marketer",
16
14
  MANTA: "Manta",
17
15
  };
18
16
  export function ChannelIcon(props) {
@@ -24,7 +22,6 @@ export function ChannelIcon(props) {
24
22
  .with("GOOGLE_ADS", () => (_jsxs("span", { className: cn("flex gap-2 items-center", className), children: [_jsx(GoogleAdsIcon, { className: cn("size-6", iconClassName), rounded: rounded }), showName && _jsx("span", { className: "typography-small-semibold", children: channelDisplayName.GOOGLE_ADS })] })))
25
23
  .with("SNAPCHAT", () => (_jsxs("span", { className: cn("flex gap-2 items-center", className), children: [_jsx(SnapChatIcon, { className: cn("size-6", iconClassName), rounded: rounded }), showName && _jsx("span", { className: "typography-small-semibold", children: channelDisplayName.SNAPCHAT })] })))
26
24
  .with("SHOPIFY", () => (_jsxs("span", { className: cn("flex gap-2 items-center", className), children: [_jsx(ShopifyIcon, { className: cn("size-6", iconClassName), rounded: rounded }), showName && _jsx("span", { className: "typography-small-semibold", children: channelDisplayName.SHOPIFY })] })))
27
- .with("MARKETER", () => (_jsxs("span", { className: cn("flex gap-2 items-center", className), children: [_jsx(MarketerIcon, { className: cn("size-6", iconClassName) }), showName && _jsx("span", { className: "typography-small-semibold", children: channelDisplayName.MARKETER })] })))
28
25
  .with("MANTA", () => (_jsxs("span", { className: cn("flex gap-2 items-center", className), children: [_jsx(MantaIcon, { className: cn("size-6", iconClassName) }), showName && _jsx("span", { className: "typography-small-semibold", children: channelDisplayName.MANTA })] })))
29
26
  .exhaustive();
30
27
  }
@@ -33,4 +30,3 @@ export { GoogleAdsIcon } from "./google-ads-icon.js";
33
30
  export { SnapChatIcon } from "./snapchat-icon.js";
34
31
  export { ShopifyIcon } from "./shopify-icon.js";
35
32
  export { MantaIcon } from "./manta-icon.js";
36
- export { MarketerIcon } from "./marketer-icon.js";
@@ -1,3 +1,4 @@
1
+ import type { GQLIntegration } from "@manta-eu/client";
1
2
  import type { ElementType } from "react";
2
3
  export type PlanState = "DRAFT" | "RUNNING" | "FAILED" | "TIMED_OUT" | "COMPLETED";
3
4
  export type PlanHowTo = {
@@ -9,7 +10,7 @@ export type PlanHowTo = {
9
10
  export type PlanRowPlan = {
10
11
  iri: string;
11
12
  state?: PlanState | null;
12
- primaryIntegration?: string | null;
13
+ primaryIntegration?: GQLIntegration | null;
13
14
  actionCount: number;
14
15
  completedActionCount: number;
15
16
  subjects: number;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/plan-row/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAOzC,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;AAEnF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA0EF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAsE1C;AAED,wBAAgB,iBAAiB,4CAShC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/plan-row/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAQzC,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;AAEnF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,kBAAkB,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA2DF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,2CAsE1C;AAED,wBAAgB,iBAAiB,4CAShC"}
@@ -4,6 +4,7 @@ import { Clock, Ellipsis, Zap } from "lucide-react";
4
4
  import { match } from "ts-pattern";
5
5
  import { Link } from "../button/index.js";
6
6
  import { ChannelIcon } from "../channel-icon/index.js";
7
+ import { integrationToChannel } from "../planning/plan-detail-utils.js";
7
8
  import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/index.js";
8
9
  import { cn } from "#style";
9
10
  function isActivePlan(state) {
@@ -63,23 +64,10 @@ function extractPlanName(iri) {
63
64
  const separator = Math.max(lastHash, lastSlash);
64
65
  return separator > -1 ? iri.slice(separator + 1) : iri;
65
66
  }
66
- function integrationToChannel(integration) {
67
- if (integration === "GOOGLE")
68
- return "GOOGLE_ADS";
69
- if (integration === "META" ||
70
- integration === "GOOGLE_ADS" ||
71
- integration === "SNAPCHAT" ||
72
- integration === "SHOPIFY" ||
73
- integration === "MARKETER" ||
74
- integration === "MANTA") {
75
- return integration;
76
- }
77
- return null;
78
- }
79
67
  export function PlanRow(props) {
80
68
  const { plan, href, component, className } = props;
81
69
  const status = getStatusConfig(plan.state);
82
- const channel = integrationToChannel(plan.primaryIntegration);
70
+ const channel = plan.primaryIntegration ? integrationToChannel(plan.primaryIntegration) : null;
83
71
  const actionCount = getActionCount(plan);
84
72
  const timeEstimate = getTimeEstimate(plan);
85
73
  const planName = plan.howTo?.name ?? extractPlanName(plan.iri);