@burdenoff/microfe-coolandlovely 2026.827.1 → 2026.1024.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.
- package/dist/coolandlovely/components/ActivityTrail.js +7 -7
- package/dist/coolandlovely/components/Comments.js +4 -4
- package/dist/coolandlovely/components/FeedbackWidget.d.ts.map +1 -1
- package/dist/coolandlovely/components/FeedbackWidget.js +72 -70
- package/dist/coolandlovely/components/FeedbackWidget.js.map +1 -1
- package/dist/coolandlovely/components/LookCard.js +24 -24
- package/dist/coolandlovely/components/StateViews.d.ts.map +1 -1
- package/dist/coolandlovely/components/StateViews.js +35 -26
- package/dist/coolandlovely/components/StateViews.js.map +1 -1
- package/dist/coolandlovely/components/StatusBadge.d.ts.map +1 -1
- package/dist/coolandlovely/components/StatusBadge.js +45 -15
- package/dist/coolandlovely/components/StatusBadge.js.map +1 -1
- package/dist/coolandlovely/components/VisibilityChip.d.ts.map +1 -1
- package/dist/coolandlovely/components/VisibilityChip.js +22 -17
- package/dist/coolandlovely/components/VisibilityChip.js.map +1 -1
- package/dist/coolandlovely/hooks/index.d.ts +1 -0
- package/dist/coolandlovely/hooks/index.d.ts.map +1 -1
- package/dist/coolandlovely/hooks/index.js +2 -1
- package/dist/coolandlovely/hooks/useTr.d.ts +2 -0
- package/dist/coolandlovely/hooks/useTr.d.ts.map +1 -0
- package/dist/coolandlovely/hooks/useTr.js +14 -0
- package/dist/coolandlovely/hooks/useTr.js.map +1 -0
- package/dist/coolandlovely/pages/HomePage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/HomePage.js +172 -132
- package/dist/coolandlovely/pages/HomePage.js.map +1 -1
- package/dist/coolandlovely/pages/admin/AdminBrandsPage.js +10 -10
- package/dist/coolandlovely/pages/admin/AdminCollaborationsPage.js +16 -16
- package/dist/coolandlovely/pages/admin/AdminFeaturedItemsPage.js +17 -17
- package/dist/coolandlovely/pages/brands/BrandDetailPage.js +22 -22
- package/dist/coolandlovely/pages/brands/BrandFormPage.js +9 -9
- package/dist/coolandlovely/pages/brands/BrandsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/brands/BrandsListPage.js +80 -76
- package/dist/coolandlovely/pages/brands/BrandsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.js +21 -21
- package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.js +7 -7
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js +82 -81
- package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/collections/CollectionDetailPage.js +19 -19
- package/dist/coolandlovely/pages/collections/CollectionFormPage.js +9 -9
- package/dist/coolandlovely/pages/collections/CollectionsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/collections/CollectionsListPage.js +54 -55
- package/dist/coolandlovely/pages/collections/CollectionsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/discover/DiscoverPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/discover/DiscoverPage.js +322 -315
- package/dist/coolandlovely/pages/discover/DiscoverPage.js.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemDetailPage.js +21 -21
- package/dist/coolandlovely/pages/items/StyleItemFormPage.js +10 -10
- package/dist/coolandlovely/pages/items/StyleItemsListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/items/StyleItemsListPage.js +105 -95
- package/dist/coolandlovely/pages/items/StyleItemsListPage.js.map +1 -1
- package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js +20 -20
- package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js.map +1 -1
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js +88 -79
- package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js.map +1 -1
- package/dist/coolandlovely/pages/looks/LookDetailPage.js +18 -18
- package/dist/coolandlovely/pages/looks/LookFormPage.js +6 -6
- package/dist/coolandlovely/pages/looks/LookFormPage.js.map +1 -1
- package/dist/coolandlovely/pages/looks/LooksListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/looks/LooksListPage.js +94 -94
- package/dist/coolandlovely/pages/looks/LooksListPage.js.map +1 -1
- package/dist/coolandlovely/pages/profile/StyleProfilePage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/profile/StyleProfilePage.js +226 -199
- package/dist/coolandlovely/pages/profile/StyleProfilePage.js.map +1 -1
- package/dist/coolandlovely/pages/trends/TrendsPage.js +8 -8
- package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js +5 -5
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.d.ts.map +1 -1
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js +71 -69
- package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,129 +1,130 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useCollaborations as o } from "../../hooks/useCoolAndLovelyApi.js";
|
|
7
|
-
import { formatDate as s, formatPrice as c, titleCase as l } from "../../utils/formatters.js";
|
|
4
|
+
import { useCollaborations as r } from "../../hooks/useCoolAndLovelyApi.js";
|
|
5
|
+
import { useTr as i } from "../../hooks/useTr.js";
|
|
8
6
|
import "../../hooks/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
7
|
+
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
8
|
+
import { ErrorView as o, LoadingView as s } from "../../components/StateViews.js";
|
|
9
|
+
import { formatDate as c, formatPrice as l, titleCase as u } from "../../utils/formatters.js";
|
|
10
|
+
import { EmptyState as d } from "../../components/EmptyState.js";
|
|
11
|
+
import { ActorName as f } from "../../components/ActorName.js";
|
|
12
|
+
import { BrandCreatorAvatars as p } from "../../components/BrandCreatorAvatars.js";
|
|
13
|
+
import { useMemo as m, useState as h } from "react";
|
|
14
|
+
import { Handshake as g, Plus as _ } from "lucide-react";
|
|
15
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
16
|
//#region src/coolandlovely/pages/collaborations/CollaborationsListPage.tsx
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
label: "Proposed"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
value: "ACCEPTED",
|
|
27
|
-
label: "Accepted"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
value: "IN_PROGRESS",
|
|
31
|
-
label: "In progress"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
value: "PUBLISHED",
|
|
35
|
-
label: "Published"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
value: "DECLINED",
|
|
39
|
-
label: "Declined"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
value: "CANCELLED",
|
|
43
|
-
label: "Cancelled"
|
|
44
|
-
}
|
|
17
|
+
var b = [
|
|
18
|
+
"PROPOSED",
|
|
19
|
+
"ACCEPTED",
|
|
20
|
+
"IN_PROGRESS",
|
|
21
|
+
"PUBLISHED",
|
|
22
|
+
"DECLINED",
|
|
23
|
+
"CANCELLED"
|
|
45
24
|
];
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
function x(e) {
|
|
26
|
+
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
27
|
+
}
|
|
28
|
+
function S() {
|
|
29
|
+
let { navigateTo: S } = e(), C = i(), [w, T] = h("ALL"), E = m(() => [{
|
|
30
|
+
value: "ALL",
|
|
31
|
+
label: C("coolandlovely.filters.all", "All")
|
|
32
|
+
}, ...b.map((e) => ({
|
|
33
|
+
value: e,
|
|
34
|
+
label: C(`coolandlovely.status.${e.toLowerCase()}`, x(e))
|
|
35
|
+
}))], [C]), D = r({ status: w === "ALL" ? void 0 : w }), O = D.data ?? [];
|
|
36
|
+
return /* @__PURE__ */ y(n, {
|
|
37
|
+
title: C("coolandlovely.page.collaborationsTitle", "Collaborations"),
|
|
38
|
+
description: C("coolandlovely.page.collaborationsSubtitle", "Brand × creator partnerships with a real lifecycle"),
|
|
39
|
+
actions: /* @__PURE__ */ y("button", {
|
|
52
40
|
type: "button",
|
|
53
|
-
onClick: () =>
|
|
41
|
+
onClick: () => S("/collaborations/new"),
|
|
54
42
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
55
|
-
children: [
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ v(_, { className: "h-4 w-4" }),
|
|
45
|
+
" ",
|
|
46
|
+
C("coolandlovely.actions.newCollaboration", "New collaboration")
|
|
47
|
+
]
|
|
56
48
|
}),
|
|
57
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ v("div", {
|
|
58
50
|
className: "mb-6 flex flex-wrap items-center gap-2",
|
|
59
|
-
children:
|
|
51
|
+
children: E.map((e) => /* @__PURE__ */ v("button", {
|
|
60
52
|
type: "button",
|
|
61
|
-
onClick: () =>
|
|
62
|
-
className: t("rounded-full px-3 py-1.5 text-sm font-medium transition-colors",
|
|
53
|
+
onClick: () => T(e.value),
|
|
54
|
+
className: t("rounded-full px-3 py-1.5 text-sm font-medium transition-colors", w === e.value ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
63
55
|
children: e.label
|
|
64
56
|
}, e.value))
|
|
65
|
-
}),
|
|
57
|
+
}), D.isLoading ? /* @__PURE__ */ v(s, { label: C("coolandlovely.loading.collaborations", "Loading collaborations…") }) : D.isError ? /* @__PURE__ */ v(o, { onRetry: () => void D.refetch() }) : O.length === 0 ? /* @__PURE__ */ v(d, {
|
|
66
58
|
illustration: "empty-data",
|
|
67
|
-
icon: /* @__PURE__ */ g
|
|
68
|
-
title: "No collaborations yet",
|
|
69
|
-
description: "Propose a brand × creator partnership to get started.",
|
|
70
|
-
action: /* @__PURE__ */
|
|
59
|
+
icon: /* @__PURE__ */ v(g, { className: "h-10 w-10" }),
|
|
60
|
+
title: C("coolandlovely.empty.collaborationsTitle", "No collaborations yet"),
|
|
61
|
+
description: C("coolandlovely.empty.collaborationsDescription", "Propose a brand × creator partnership to get started."),
|
|
62
|
+
action: /* @__PURE__ */ y("button", {
|
|
71
63
|
type: "button",
|
|
72
|
-
onClick: () =>
|
|
64
|
+
onClick: () => S("/collaborations/new"),
|
|
73
65
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
74
|
-
children: [
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ v(_, { className: "h-4 w-4" }),
|
|
68
|
+
" ",
|
|
69
|
+
C("coolandlovely.actions.newCollaboration", "New collaboration")
|
|
70
|
+
]
|
|
75
71
|
})
|
|
76
|
-
}) : /* @__PURE__ */
|
|
72
|
+
}) : /* @__PURE__ */ v("div", {
|
|
77
73
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
78
|
-
children:
|
|
74
|
+
children: O.map((e) => /* @__PURE__ */ y("button", {
|
|
79
75
|
type: "button",
|
|
80
|
-
onClick: () =>
|
|
76
|
+
onClick: () => S(`/collaborations/${e.id}`),
|
|
81
77
|
className: "flex flex-col rounded-lg border border-border-seam bg-bg-surface p-4 text-left shadow-sm transition-all hover:border-accent-foreground/20 hover:shadow-md",
|
|
82
78
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ y("div", {
|
|
84
80
|
className: "flex items-start gap-3",
|
|
85
81
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ v(p, {
|
|
87
83
|
brandLogoFileId: e.brand?.logo?.id,
|
|
88
84
|
brandSeed: e.brandId,
|
|
89
85
|
creatorId: e.creatorId,
|
|
90
86
|
size: "sm",
|
|
91
87
|
className: "shrink-0"
|
|
92
88
|
}),
|
|
93
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ y("div", {
|
|
94
90
|
className: "min-w-0 flex-1",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
96
92
|
className: "truncate text-base font-semibold text-text-primary",
|
|
97
93
|
children: e.title
|
|
98
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ y("p", {
|
|
99
95
|
className: "truncate text-xs text-text-secondary",
|
|
100
96
|
children: [
|
|
101
|
-
e.brand?.name ?? "Brand",
|
|
102
|
-
" ×
|
|
103
|
-
|
|
97
|
+
e.brand?.name ?? C("coolandlovely.common.brand", "Brand"),
|
|
98
|
+
" ×",
|
|
99
|
+
" ",
|
|
100
|
+
/* @__PURE__ */ v(f, { id: e.creatorId })
|
|
104
101
|
]
|
|
105
102
|
})]
|
|
106
103
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ v(a, { status: e.status })
|
|
108
105
|
]
|
|
109
106
|
}),
|
|
110
|
-
e.brief && /* @__PURE__ */
|
|
107
|
+
e.brief && /* @__PURE__ */ v("p", {
|
|
111
108
|
className: "mt-3 line-clamp-2 text-sm text-text-secondary",
|
|
112
109
|
children: e.brief
|
|
113
110
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ y("div", {
|
|
115
112
|
className: "mt-3 flex items-center justify-between text-xs text-text-secondary",
|
|
116
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ v("span", {
|
|
117
114
|
className: "rounded-full bg-bg-sunken px-2 py-0.5",
|
|
118
|
-
children:
|
|
119
|
-
}), /* @__PURE__ */
|
|
115
|
+
children: C(`coolandlovely.role.${e.role.toLowerCase()}`, u(e.role))
|
|
116
|
+
}), /* @__PURE__ */ v("span", { children: l(e.compensation, e.currency) })]
|
|
120
117
|
}),
|
|
121
|
-
e.startDate && /* @__PURE__ */
|
|
118
|
+
e.startDate && /* @__PURE__ */ y("p", {
|
|
122
119
|
className: "mt-2 text-xs text-text-secondary",
|
|
123
|
-
children: [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
children: [
|
|
121
|
+
C("coolandlovely.common.starts", "Starts"),
|
|
122
|
+
" ",
|
|
123
|
+
c(e.startDate, {
|
|
124
|
+
hour: void 0,
|
|
125
|
+
minute: void 0
|
|
126
|
+
})
|
|
127
|
+
]
|
|
127
128
|
})
|
|
128
129
|
]
|
|
129
130
|
}, e.id))
|
|
@@ -131,6 +132,6 @@ function y() {
|
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
134
|
//#endregion
|
|
134
|
-
export {
|
|
135
|
+
export { S as CollaborationsListPage };
|
|
135
136
|
|
|
136
137
|
//# sourceMappingURL=CollaborationsListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollaborationsListPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/collaborations/CollaborationsListPage.tsx"],"sourcesContent":["/**\n * Collaborations List Page\n * @module coolandlovely/pages/collaborations\n *\n * Lists brand × creator partnerships (`cooListCollaborations`) with status\n * filter.\n */\n\nimport { useState } from 'react';\nimport { Plus, Handshake } from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { BrandCreatorAvatars } from '../../components/BrandCreatorAvatars';\nimport { ActorName } from '../../components/ActorName';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useCollaborations } from '../../hooks';\nimport { formatPrice, formatDate, titleCase } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type { CooCollaborationStatus } from '../../types';\n\nconst
|
|
1
|
+
{"version":3,"file":"CollaborationsListPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/collaborations/CollaborationsListPage.tsx"],"sourcesContent":["/**\n * Collaborations List Page\n * @module coolandlovely/pages/collaborations\n *\n * Lists brand × creator partnerships (`cooListCollaborations`) with status\n * filter.\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, Handshake } from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { BrandCreatorAvatars } from '../../components/BrandCreatorAvatars';\nimport { ActorName } from '../../components/ActorName';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useCollaborations, useTr } from '../../hooks';\nimport { formatPrice, formatDate, titleCase } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type { CooCollaborationStatus } from '../../types';\n\nconst STATUS_ORDER: CooCollaborationStatus[] = [\n 'PROPOSED',\n 'ACCEPTED',\n 'IN_PROGRESS',\n 'PUBLISHED',\n 'DECLINED',\n 'CANCELLED',\n];\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nexport function CollaborationsListPage() {\n const { navigateTo } = useCoolAndLovely();\n const tr = useTr();\n const [status, setStatus] = useState<CooCollaborationStatus | 'ALL'>('ALL');\n\n const statusOptions = useMemo(\n () => [\n { value: 'ALL' as const, label: tr('coolandlovely.filters.all', 'All') },\n ...STATUS_ORDER.map((value) => ({\n value,\n label: tr(`coolandlovely.status.${value.toLowerCase()}`, formatStatusLabel(value)),\n })),\n ],\n [tr]\n );\n\n const query = useCollaborations({ status: status === 'ALL' ? undefined : status });\n const collaborations = query.data ?? [];\n\n return (\n <PageLayout\n title={tr('coolandlovely.page.collaborationsTitle', 'Collaborations')}\n description={tr(\n 'coolandlovely.page.collaborationsSubtitle',\n 'Brand × creator partnerships with a real lifecycle'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/collaborations/new')}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" />{' '}\n {tr('coolandlovely.actions.newCollaboration', 'New collaboration')}\n </button>\n }\n >\n <div className=\"mb-6 flex flex-wrap items-center gap-2\">\n {statusOptions.map((opt) => (\n <button\n key={opt.value}\n type=\"button\"\n onClick={() => setStatus(opt.value)}\n className={cn(\n 'rounded-full px-3 py-1.5 text-sm font-medium transition-colors',\n status === opt.value\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'bg-bg-sunken text-text-secondary hover:text-text-primary'\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n\n {query.isLoading ? (\n <LoadingView\n label={tr('coolandlovely.loading.collaborations', 'Loading collaborations…')}\n />\n ) : query.isError ? (\n <ErrorView onRetry={() => void query.refetch()} />\n ) : collaborations.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<Handshake className=\"h-10 w-10\" />}\n title={tr('coolandlovely.empty.collaborationsTitle', 'No collaborations yet')}\n description={tr(\n 'coolandlovely.empty.collaborationsDescription',\n 'Propose a brand × creator partnership to get started.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/collaborations/new')}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Plus className=\"h-4 w-4\" />{' '}\n {tr('coolandlovely.actions.newCollaboration', 'New collaboration')}\n </button>\n }\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {collaborations.map((c) => (\n <button\n key={c.id}\n type=\"button\"\n onClick={() => navigateTo(`/collaborations/${c.id}`)}\n className=\"flex flex-col rounded-lg border border-border-seam bg-bg-surface p-4 text-left shadow-sm transition-all hover:border-accent-foreground/20 hover:shadow-md\"\n >\n <div className=\"flex items-start gap-3\">\n <BrandCreatorAvatars\n brandLogoFileId={c.brand?.logo?.id}\n brandSeed={c.brandId}\n creatorId={c.creatorId}\n size=\"sm\"\n className=\"shrink-0\"\n />\n <div className=\"min-w-0 flex-1\">\n <h3 className=\"truncate text-base font-semibold text-text-primary\">{c.title}</h3>\n <p className=\"truncate text-xs text-text-secondary\">\n {c.brand?.name ?? tr('coolandlovely.common.brand', 'Brand')} ×{' '}\n <ActorName id={c.creatorId} />\n </p>\n </div>\n <StatusBadge status={c.status} />\n </div>\n {c.brief && (\n <p className=\"mt-3 line-clamp-2 text-sm text-text-secondary\">{c.brief}</p>\n )}\n <div className=\"mt-3 flex items-center justify-between text-xs text-text-secondary\">\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5\">\n {tr(`coolandlovely.role.${c.role.toLowerCase()}`, titleCase(c.role))}\n </span>\n <span>{formatPrice(c.compensation, c.currency)}</span>\n </div>\n {c.startDate && (\n <p className=\"mt-2 text-xs text-text-secondary\">\n {tr('coolandlovely.common.starts', 'Starts')}{' '}\n {formatDate(c.startDate, { hour: undefined, minute: undefined })}\n </p>\n )}\n </button>\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Thumbnail as a } from "../../components/Thumbnail.js";
|
|
6
|
-
import { useArchiveCollection as o, useCollection as s, usePublishCollection as c } from "../../hooks/useCoolAndLovelyApi.js";
|
|
7
|
-
import { formatDate as l, formatPrice as u, titleCase as d } from "../../utils/formatters.js";
|
|
8
|
-
import { useAssistantEntityName as f } from "../../hooks/useAssistantEntity.js";
|
|
3
|
+
import { useArchiveCollection as n, useCollection as r, usePublishCollection as i } from "../../hooks/useCoolAndLovelyApi.js";
|
|
4
|
+
import { useAssistantEntityName as a } from "../../hooks/useAssistantEntity.js";
|
|
9
5
|
import "../../hooks/index.js";
|
|
6
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
7
|
+
import { ErrorView as s, LoadingView as c } from "../../components/StateViews.js";
|
|
8
|
+
import { Thumbnail as l } from "../../components/Thumbnail.js";
|
|
9
|
+
import { formatDate as u, formatPrice as d, titleCase as f } from "../../utils/formatters.js";
|
|
10
10
|
import { categoryIcon as p } from "../../utils/icons.js";
|
|
11
11
|
import { TagList as m } from "../../components/TagList.js";
|
|
12
12
|
import { ColourSwatchRow as h } from "../../components/ColourSwatchRow.js";
|
|
@@ -16,14 +16,14 @@ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
|
16
16
|
import { GlassCard as O } from "@burdenoff/fe-libs/ui";
|
|
17
17
|
//#region src/coolandlovely/pages/collections/CollectionDetailPage.tsx
|
|
18
18
|
function k() {
|
|
19
|
-
let { collectionId: k } = w(), { navigateTo: A } = e(), j =
|
|
20
|
-
if (
|
|
19
|
+
let { collectionId: k } = w(), { navigateTo: A } = e(), j = r(k), M = i(), N = n();
|
|
20
|
+
if (a(k, j.data?.name), j.isLoading) return /* @__PURE__ */ E(t, {
|
|
21
21
|
title: "Collection",
|
|
22
|
-
children: /* @__PURE__ */ E(
|
|
22
|
+
children: /* @__PURE__ */ E(c, { label: "Loading collection…" })
|
|
23
23
|
});
|
|
24
24
|
if (j.isError || !j.data) return /* @__PURE__ */ E(t, {
|
|
25
25
|
title: "Collection",
|
|
26
|
-
children: /* @__PURE__ */ E(
|
|
26
|
+
children: /* @__PURE__ */ E(s, {
|
|
27
27
|
title: "Collection not found",
|
|
28
28
|
onRetry: () => void j.refetch()
|
|
29
29
|
})
|
|
@@ -70,7 +70,7 @@ function k() {
|
|
|
70
70
|
children: [/* @__PURE__ */ D(O, {
|
|
71
71
|
treatment: "glass",
|
|
72
72
|
className: "group overflow-hidden p-0",
|
|
73
|
-
children: [/* @__PURE__ */ E(
|
|
73
|
+
children: [/* @__PURE__ */ E(l, {
|
|
74
74
|
icon: /* @__PURE__ */ E(S, { className: "h-12 w-12" }),
|
|
75
75
|
seed: P.id,
|
|
76
76
|
fileId: P.cover?.id,
|
|
@@ -94,11 +94,11 @@ function k() {
|
|
|
94
94
|
}),
|
|
95
95
|
/* @__PURE__ */ E("span", {
|
|
96
96
|
className: "rounded-full border border-border-seam bg-bg-surface/80 px-2.5 py-0.5 text-xs font-medium text-text-primary backdrop-blur-sm",
|
|
97
|
-
children:
|
|
97
|
+
children: f(P.season)
|
|
98
98
|
})
|
|
99
99
|
]
|
|
100
100
|
})]
|
|
101
|
-
}), /* @__PURE__ */ E(
|
|
101
|
+
}), /* @__PURE__ */ E(o, {
|
|
102
102
|
status: P.status,
|
|
103
103
|
className: "shrink-0 shadow-sm"
|
|
104
104
|
})]
|
|
@@ -133,7 +133,7 @@ function k() {
|
|
|
133
133
|
type: "button",
|
|
134
134
|
onClick: () => A(`/items/${e.id}`),
|
|
135
135
|
className: "group overflow-hidden rounded-lg border border-border-seam bg-bg-surface text-left transition-all hover:border-accent-foreground/20 hover:shadow-md",
|
|
136
|
-
children: [/* @__PURE__ */ E(
|
|
136
|
+
children: [/* @__PURE__ */ E(l, {
|
|
137
137
|
icon: p(e.category, 28),
|
|
138
138
|
seed: e.id,
|
|
139
139
|
fileId: e.image?.id,
|
|
@@ -148,7 +148,7 @@ function k() {
|
|
|
148
148
|
}),
|
|
149
149
|
/* @__PURE__ */ E("p", {
|
|
150
150
|
className: "mt-0.5 text-xs font-semibold text-text-primary tabular-nums",
|
|
151
|
-
children:
|
|
151
|
+
children: d(e.price, e.currency)
|
|
152
152
|
}),
|
|
153
153
|
e.colours.length > 0 && /* @__PURE__ */ E(h, {
|
|
154
154
|
colours: e.colours,
|
|
@@ -186,7 +186,7 @@ function k() {
|
|
|
186
186
|
children: "Season"
|
|
187
187
|
}), /* @__PURE__ */ E("dd", {
|
|
188
188
|
className: "text-text-primary",
|
|
189
|
-
children:
|
|
189
|
+
children: f(P.season)
|
|
190
190
|
})]
|
|
191
191
|
}),
|
|
192
192
|
/* @__PURE__ */ D("div", {
|
|
@@ -196,7 +196,7 @@ function k() {
|
|
|
196
196
|
children: "Publish at"
|
|
197
197
|
}), /* @__PURE__ */ E("dd", {
|
|
198
198
|
className: "text-text-primary",
|
|
199
|
-
children: P.publishAt ?
|
|
199
|
+
children: P.publishAt ? u(P.publishAt, {
|
|
200
200
|
hour: void 0,
|
|
201
201
|
minute: void 0
|
|
202
202
|
}) : "—"
|
|
@@ -209,7 +209,7 @@ function k() {
|
|
|
209
209
|
children: "Ends at"
|
|
210
210
|
}), /* @__PURE__ */ E("dd", {
|
|
211
211
|
className: "text-text-primary",
|
|
212
|
-
children: P.endAt ?
|
|
212
|
+
children: P.endAt ? u(P.endAt, {
|
|
213
213
|
hour: void 0,
|
|
214
214
|
minute: void 0
|
|
215
215
|
}) : "—"
|
|
@@ -222,7 +222,7 @@ function k() {
|
|
|
222
222
|
type: "button",
|
|
223
223
|
onClick: () => A(`/brands/${P.brand?.id}`),
|
|
224
224
|
className: "flex w-full items-center gap-3 rounded-lg border border-border-seam bg-bg-surface p-4 text-left transition-colors hover:bg-bg-sunken/50",
|
|
225
|
-
children: [/* @__PURE__ */ E(
|
|
225
|
+
children: [/* @__PURE__ */ E(l, {
|
|
226
226
|
icon: /* @__PURE__ */ E(C, { className: "h-5 w-5" }),
|
|
227
227
|
seed: P.brand.id,
|
|
228
228
|
className: "h-10 w-10 shrink-0"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import {
|
|
4
|
-
import { COO_FILE_FOLDERS as
|
|
5
|
-
import { useBrands as a, useCollection as o, useCreateCollection as s, useUpdateCollection as c } from "../../hooks/useCoolAndLovelyApi.js";
|
|
6
|
-
import { parseCsv as l, titleCase as u } from "../../utils/formatters.js";
|
|
3
|
+
import { useBrands as n, useCollection as r, useCreateCollection as i, useUpdateCollection as a } from "../../hooks/useCoolAndLovelyApi.js";
|
|
4
|
+
import { COO_FILE_FOLDERS as o } from "../../hooks/useFiles.js";
|
|
7
5
|
import "../../hooks/index.js";
|
|
6
|
+
import { ErrorView as s, LoadingView as c } from "../../components/StateViews.js";
|
|
7
|
+
import { parseCsv as l, titleCase as u } from "../../utils/formatters.js";
|
|
8
8
|
import { SelectField as d, TextAreaField as f, TextField as p } from "../../components/Field.js";
|
|
9
9
|
import { ImageUploadField as m } from "../../components/ImageUploadField.js";
|
|
10
10
|
import { useEffect as h, useMemo as g, useState as _ } from "react";
|
|
@@ -41,10 +41,10 @@ function A(e) {
|
|
|
41
41
|
return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
|
|
42
42
|
}
|
|
43
43
|
function j() {
|
|
44
|
-
let { collectionId: j } = S(), [M] = C(), N = !!j, { navigateTo: P } = e(), F =
|
|
44
|
+
let { collectionId: j } = S(), [M] = C(), N = !!j, { navigateTo: P } = e(), F = r(N ? j : void 0), I = n({ pagination: {
|
|
45
45
|
limit: 100,
|
|
46
46
|
offset: 0
|
|
47
|
-
} }), L =
|
|
47
|
+
} }), L = i(), R = a(), [z, B] = _(() => ({
|
|
48
48
|
...O,
|
|
49
49
|
brandId: M.get("brandId") ?? ""
|
|
50
50
|
})), [V, H] = _({});
|
|
@@ -78,10 +78,10 @@ function j() {
|
|
|
78
78
|
};
|
|
79
79
|
return N && F.isLoading ? /* @__PURE__ */ w(t, {
|
|
80
80
|
title: "Edit collection",
|
|
81
|
-
children: /* @__PURE__ */ w(
|
|
81
|
+
children: /* @__PURE__ */ w(c, { label: "Loading collection…" })
|
|
82
82
|
}) : N && (F.isError || !F.data) ? /* @__PURE__ */ w(t, {
|
|
83
83
|
title: "Edit collection",
|
|
84
|
-
children: /* @__PURE__ */ w(
|
|
84
|
+
children: /* @__PURE__ */ w(s, {
|
|
85
85
|
title: "Collection not found",
|
|
86
86
|
onRetry: () => void F.refetch()
|
|
87
87
|
})
|
|
@@ -204,7 +204,7 @@ function j() {
|
|
|
204
204
|
aspect: "wide",
|
|
205
205
|
value: z.coverFileId,
|
|
206
206
|
onChange: (e) => U("coverFileId", e),
|
|
207
|
-
folder:
|
|
207
|
+
folder: o.collections,
|
|
208
208
|
hint: "Represents the drop on cards and the collection page",
|
|
209
209
|
className: "mt-4"
|
|
210
210
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionsListPage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/collections/CollectionsListPage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"CollectionsListPage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/collections/CollectionsListPage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH,wBAAgB,mBAAmB,gCA2FlC"}
|
|
@@ -1,81 +1,80 @@
|
|
|
1
1
|
import { useCoolAndLovely as e } from "../../context/CoolAndLovelyContext.js";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
3
|
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useCollections as r } from "../../hooks/useCoolAndLovelyApi.js";
|
|
5
|
+
import { useTr as i } from "../../hooks/useTr.js";
|
|
6
6
|
import "../../hooks/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { ErrorView as a, LoadingView as o } from "../../components/StateViews.js";
|
|
8
|
+
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
9
|
+
import { CollectionCard as c } from "../../components/CollectionCard.js";
|
|
10
|
+
import { useMemo as l, useState as u } from "react";
|
|
11
|
+
import { Plus as d, Shapes as f } from "lucide-react";
|
|
12
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
13
|
//#region src/coolandlovely/pages/collections/CollectionsListPage.tsx
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
value: "LIVE",
|
|
20
|
-
label: "Live"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
value: "SCHEDULED",
|
|
24
|
-
label: "Scheduled"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
value: "DRAFT",
|
|
28
|
-
label: "Draft"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
value: "ENDED",
|
|
32
|
-
label: "Ended"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
value: "ARCHIVED",
|
|
36
|
-
label: "Archived"
|
|
37
|
-
}
|
|
14
|
+
var h = [
|
|
15
|
+
"LIVE",
|
|
16
|
+
"SCHEDULED",
|
|
17
|
+
"DRAFT",
|
|
18
|
+
"ENDED",
|
|
19
|
+
"ARCHIVED"
|
|
38
20
|
];
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
function g(e) {
|
|
22
|
+
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
23
|
+
}
|
|
24
|
+
function _() {
|
|
25
|
+
let { navigateTo: _ } = e(), v = i(), [y, b] = u("ALL"), x = l(() => [{
|
|
26
|
+
value: "ALL",
|
|
27
|
+
label: v("coolandlovely.filters.all", "All")
|
|
28
|
+
}, ...h.map((e) => ({
|
|
29
|
+
value: e,
|
|
30
|
+
label: v(`coolandlovely.status.${e.toLowerCase()}`, g(e))
|
|
31
|
+
}))], [v]), S = r({ status: y === "ALL" ? void 0 : y }), C = S.data ?? [];
|
|
32
|
+
return /* @__PURE__ */ m(n, {
|
|
33
|
+
title: v("coolandlovely.page.collectionsTitle", "Collections"),
|
|
34
|
+
description: v("coolandlovely.page.collectionsSubtitle", "Seasonal drops and curated edits grouped by brand"),
|
|
35
|
+
actions: /* @__PURE__ */ m("button", {
|
|
45
36
|
type: "button",
|
|
46
|
-
onClick: () =>
|
|
37
|
+
onClick: () => _("/collections/new"),
|
|
47
38
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
48
|
-
children: [
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ p(d, { className: "h-4 w-4" }),
|
|
41
|
+
" ",
|
|
42
|
+
v("coolandlovely.actions.newCollection", "New collection")
|
|
43
|
+
]
|
|
49
44
|
}),
|
|
50
|
-
children: [/* @__PURE__ */
|
|
45
|
+
children: [/* @__PURE__ */ p("div", {
|
|
51
46
|
className: "mb-6 flex flex-wrap items-center gap-2",
|
|
52
|
-
children:
|
|
47
|
+
children: x.map((e) => /* @__PURE__ */ p("button", {
|
|
53
48
|
type: "button",
|
|
54
|
-
onClick: () =>
|
|
55
|
-
className: t("rounded-full px-3 py-1.5 text-sm font-medium transition-colors",
|
|
49
|
+
onClick: () => b(e.value),
|
|
50
|
+
className: t("rounded-full px-3 py-1.5 text-sm font-medium transition-colors", y === e.value ? "bg-accent-purple-subtle text-text-primary" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
56
51
|
children: e.label
|
|
57
52
|
}, e.value))
|
|
58
|
-
}),
|
|
53
|
+
}), S.isLoading ? /* @__PURE__ */ p(o, { label: v("coolandlovely.loading.collections", "Loading collections…") }) : S.isError ? /* @__PURE__ */ p(a, { onRetry: () => void S.refetch() }) : C.length === 0 ? /* @__PURE__ */ p(s, {
|
|
59
54
|
illustration: "empty-data",
|
|
60
|
-
icon: /* @__PURE__ */
|
|
61
|
-
title: "No collections yet",
|
|
62
|
-
description: "Group pieces into a seasonal drop to start a collection.",
|
|
63
|
-
action: /* @__PURE__ */
|
|
55
|
+
icon: /* @__PURE__ */ p(f, { className: "h-10 w-10" }),
|
|
56
|
+
title: v("coolandlovely.empty.collectionsTitle", "No collections yet"),
|
|
57
|
+
description: v("coolandlovely.empty.collectionsDescription", "Group pieces into a seasonal drop to start a collection."),
|
|
58
|
+
action: /* @__PURE__ */ m("button", {
|
|
64
59
|
type: "button",
|
|
65
|
-
onClick: () =>
|
|
60
|
+
onClick: () => _("/collections/new"),
|
|
66
61
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text",
|
|
67
|
-
children: [
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ p(d, { className: "h-4 w-4" }),
|
|
64
|
+
" ",
|
|
65
|
+
v("coolandlovely.actions.newCollection", "New collection")
|
|
66
|
+
]
|
|
68
67
|
})
|
|
69
|
-
}) : /* @__PURE__ */
|
|
68
|
+
}) : /* @__PURE__ */ p("div", {
|
|
70
69
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
71
|
-
children:
|
|
70
|
+
children: C.map((e) => /* @__PURE__ */ p(c, {
|
|
72
71
|
collection: e,
|
|
73
|
-
onClick: () =>
|
|
72
|
+
onClick: () => _(`/collections/${e.id}`)
|
|
74
73
|
}, e.id))
|
|
75
74
|
})]
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
77
|
//#endregion
|
|
79
|
-
export {
|
|
78
|
+
export { _ as CollectionsListPage };
|
|
80
79
|
|
|
81
80
|
//# sourceMappingURL=CollectionsListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CollectionsListPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/collections/CollectionsListPage.tsx"],"sourcesContent":["/**\n * Collections List Page\n * @module coolandlovely/pages/collections\n *\n * Lists seasonal collections (`cooListCollections`) with status filter.\n */\n\nimport { useState } from 'react';\nimport { Plus, Shapes } from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { CollectionCard } from '../../components/CollectionCard';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useCollections } from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport type { CooCollectionStatus } from '../../types';\n\nconst
|
|
1
|
+
{"version":3,"file":"CollectionsListPage.js","names":[],"sources":["../../../../src/coolandlovely/pages/collections/CollectionsListPage.tsx"],"sourcesContent":["/**\n * Collections List Page\n * @module coolandlovely/pages/collections\n *\n * Lists seasonal collections (`cooListCollections`) with status filter.\n */\n\nimport { useMemo, useState } from 'react';\nimport { Plus, Shapes } from 'lucide-react';\nimport { PageLayout } from '../../components/PageLayout';\nimport { CollectionCard } from '../../components/CollectionCard';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { useCoolAndLovely } from '../../context/CoolAndLovelyContext';\nimport { useCollections, useTr } from '../../hooks';\nimport { cn } from '../../utils/cn';\nimport type { CooCollectionStatus } from '../../types';\n\nconst STATUS_ORDER: CooCollectionStatus[] = ['LIVE', 'SCHEDULED', 'DRAFT', 'ENDED', 'ARCHIVED'];\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (c) => c.toUpperCase());\n}\n\nexport function CollectionsListPage() {\n const { navigateTo } = useCoolAndLovely();\n const tr = useTr();\n const [status, setStatus] = useState<CooCollectionStatus | 'ALL'>('ALL');\n\n const statusOptions = useMemo(\n () => [\n { value: 'ALL' as const, label: tr('coolandlovely.filters.all', 'All') },\n ...STATUS_ORDER.map((value) => ({\n value,\n label: tr(`coolandlovely.status.${value.toLowerCase()}`, formatStatusLabel(value)),\n })),\n ],\n [tr]\n );\n\n const query = useCollections({ status: status === 'ALL' ? undefined : status });\n const collections = query.data ?? [];\n\n return (\n <PageLayout\n title={tr('coolandlovely.page.collectionsTitle', 'Collections')}\n description={tr(\n 'coolandlovely.page.collectionsSubtitle',\n 'Seasonal drops and curated edits grouped by brand'\n )}\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/collections/new')}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90\"\n >\n <Plus className=\"h-4 w-4\" /> {tr('coolandlovely.actions.newCollection', 'New collection')}\n </button>\n }\n >\n <div className=\"mb-6 flex flex-wrap items-center gap-2\">\n {statusOptions.map((opt) => (\n <button\n key={opt.value}\n type=\"button\"\n onClick={() => setStatus(opt.value)}\n className={cn(\n 'rounded-full px-3 py-1.5 text-sm font-medium transition-colors',\n status === opt.value\n ? 'bg-accent-purple-subtle text-text-primary'\n : 'bg-bg-sunken text-text-secondary hover:text-text-primary'\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n\n {query.isLoading ? (\n <LoadingView label={tr('coolandlovely.loading.collections', 'Loading collections…')} />\n ) : query.isError ? (\n <ErrorView onRetry={() => void query.refetch()} />\n ) : collections.length === 0 ? (\n <EmptyState\n illustration=\"empty-data\"\n icon={<Shapes className=\"h-10 w-10\" />}\n title={tr('coolandlovely.empty.collectionsTitle', 'No collections yet')}\n description={tr(\n 'coolandlovely.empty.collectionsDescription',\n 'Group pieces into a seasonal drop to start a collection.'\n )}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/collections/new')}\n className=\"inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text\"\n >\n <Plus className=\"h-4 w-4\" />{' '}\n {tr('coolandlovely.actions.newCollection', 'New collection')}\n </button>\n }\n />\n ) : (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {collections.map((collection) => (\n <CollectionCard\n key={collection.id}\n collection={collection}\n onClick={() => navigateTo(`/collections/${collection.id}`)}\n />\n ))}\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAM,IAAsC;CAAC;CAAQ;CAAa;CAAS;CAAS;CAAW;AAE/F,SAAS,EAAkB,GAAwB;AACjD,QAAO,EAAO,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAM,EAAE,aAAa,CAAC;;AAG3E,SAAgB,IAAsB;CACpC,IAAM,EAAE,kBAAe,GAAkB,EACnC,IAAK,GAAO,EACZ,CAAC,GAAQ,KAAa,EAAsC,MAAM,EAElE,IAAgB,QACd,CACJ;EAAE,OAAO;EAAgB,OAAO,EAAG,6BAA6B,MAAM;EAAE,EACxE,GAAG,EAAa,KAAK,OAAW;EAC9B;EACA,OAAO,EAAG,wBAAwB,EAAM,aAAa,IAAI,EAAkB,EAAM,CAAC;EACnF,EAAE,CACJ,EACD,CAAC,EAAG,CACL,EAEK,IAAQ,EAAe,EAAE,QAAQ,MAAW,QAAQ,KAAA,IAAY,GAAQ,CAAC,EACzE,IAAc,EAAM,QAAQ,EAAE;AAEpC,QACE,kBAAC,GAAD;EACE,OAAO,EAAG,uCAAuC,cAAc;EAC/D,aAAa,EACX,0CACA,oDACD;EACD,SACE,kBAAC,UAAD;GACE,MAAK;GACL,eAAe,EAAW,mBAAmB;GAC7C,WAAU;aAHZ;IAKE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;;IAAE,EAAG,uCAAuC,iBAAiB;IAClF;;YAbb,CAgBE,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAc,KAAK,MAClB,kBAAC,UAAD;IAEE,MAAK;IACL,eAAe,EAAU,EAAI,MAAM;IACnC,WAAW,EACT,kEACA,MAAW,EAAI,QACX,8CACA,2DACL;cAEA,EAAI;IACE,EAXF,EAAI,MAWF,CACT;GACE,CAAA,EAEL,EAAM,YACL,kBAAC,GAAD,EAAa,OAAO,EAAG,qCAAqC,uBAAuB,EAAI,CAAA,GACrF,EAAM,UACR,kBAAC,GAAD,EAAW,eAAe,KAAK,EAAM,SAAS,EAAI,CAAA,GAChD,EAAY,WAAW,IACzB,kBAAC,GAAD;GACE,cAAa;GACb,MAAM,kBAAC,GAAD,EAAQ,WAAU,aAAc,CAAA;GACtC,OAAO,EAAG,wCAAwC,qBAAqB;GACvE,aAAa,EACX,8CACA,2DACD;GACD,QACE,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAW,mBAAmB;IAC7C,WAAU;cAHZ;KAKE,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;KAAC;KAC5B,EAAG,uCAAuC,iBAAiB;KACrD;;GAEX,CAAA,GAEF,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAY,KAAK,MAChB,kBAAC,GAAD;IAEc;IACZ,eAAe,EAAW,gBAAgB,EAAW,KAAK;IAC1D,EAHK,EAAW,GAGhB,CACF;GACE,CAAA,CAEG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiscoverPage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/discover/DiscoverPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"DiscoverPage.d.ts","sourceRoot":"","sources":["../../../../src/coolandlovely/pages/discover/DiscoverPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA6JH,wBAAgB,YAAY,gCAkxB3B"}
|