tangled
alpha
login
or
join now
taurean.bryant.land
/
drydown
1
fork
atom
a a vibe-coded abomination experiment of a fragrance review platform built on the atmosphere.
drydown.social
1
fork
atom
overview
issues
pulls
pipelines
fixing the dashboard
taurean.bryant.land
2 months ago
ebebd383
569d736f
+18
-16
4 changed files
expand all
collapse all
unified
split
src
components
ReviewCard.tsx
ReviewDashboard.tsx
ReviewList.tsx
utils
reviewUtils.ts
+8
-3
src/components/ReviewCard.tsx
···
3
3
interface ReviewCardProps {
4
4
review: { uri: string; value: any }
5
5
fragranceName: string
6
6
-
status: 'ready' | 'waiting' | 'completed'
6
6
+
status: 'ready' | 'inProgress' | 'completed'
7
7
}
8
8
9
9
export function ReviewCard({ review, fragranceName, status }: ReviewCardProps) {
···
26
26
</div>
27
27
)}
28
28
29
29
-
{status === 'waiting' && (
29
29
+
{status === 'inProgress' && (
30
30
<div style={{ fontSize: '0.9rem', color: '#666' }}>
31
31
-
Waiting for Stage 2 (come back in {Math.ceil((2 - calculateElapsedHours(value.createdAt)) * 60)} minutes)
31
31
+
{/* Logic to show what we are waiting for */}
32
32
+
{!value.drydownRating ? (
33
33
+
<span>Next: Stage 2 (in {Math.ceil((2 - calculateElapsedHours(value.createdAt)) * 60)} mins)</span>
34
34
+
) : (
35
35
+
<span>Next: Stage 3 (in {Math.ceil((4 - calculateElapsedHours(value.createdAt)) * 60)} mins)</span>
36
36
+
)}
32
37
</div>
33
38
)}
34
39
+1
-1
src/components/ReviewDashboard.tsx
···
15
15
16
16
useEffect(() => {
17
17
async function initClient() {
18
18
-
const baseClient = new AtpBaseClient(session.fetchHandler)
18
18
+
const baseClient = new AtpBaseClient(session.fetchHandler.bind(session))
19
19
await loadData(baseClient)
20
20
}
21
21
initClient()
+5
-5
src/components/ReviewList.tsx
···
7
7
}
8
8
9
9
export function ReviewList({ reviews, fragrances }: ReviewListProps) {
10
10
-
const { readyToUpdate, waiting, completed } = categorizeReviews(reviews)
10
10
+
const { readyToUpdate, inProgress, completed } = categorizeReviews(reviews)
11
11
12
12
const getFragranceName = (fragranceUri: string) => {
13
13
return fragrances.get(fragranceUri)?.name || 'Unknown Fragrance'
···
31
31
</section>
32
32
)}
33
33
34
34
-
{waiting.length > 0 && (
34
34
+
{inProgress.length > 0 && (
35
35
<section style={{ marginBottom: '2rem' }}>
36
36
<h3 style={{ fontSize: '1.2rem', marginBottom: '1rem', color: '#666' }}>
37
37
-
Waiting ({waiting.length})
37
37
+
In Progress ({inProgress.length})
38
38
</h3>
39
39
-
{waiting.map(review => (
39
39
+
{inProgress.map(review => (
40
40
<ReviewCard
41
41
key={review.uri}
42
42
review={review}
43
43
fragranceName={getFragranceName(review.value.fragrance)}
44
44
-
status="waiting"
44
44
+
status="inProgress"
45
45
/>
46
46
))}
47
47
</section>
+4
-7
src/utils/reviewUtils.ts
···
105
105
// Review categorization
106
106
export function categorizeReviews(reviews: Array<{ uri: string; value: any }>) {
107
107
const readyToUpdate: typeof reviews = []
108
108
-
const waiting: typeof reviews = []
108
108
+
const inProgress: typeof reviews = []
109
109
const completed: typeof reviews = []
110
110
111
111
for (const review of reviews) {
···
116
116
if (stage) {
117
117
readyToUpdate.push(review)
118
118
} else {
119
119
-
const elapsed = calculateElapsedHours(review.value.createdAt)
120
120
-
// Only show in "waiting" if created in last hour
121
121
-
if (elapsed < 1) {
122
122
-
waiting.push(review)
123
123
-
}
119
119
+
// If not completed and not ready for next stage, it is in progress (waiting for timer)
120
120
+
inProgress.push(review)
124
121
}
125
122
}
126
123
}
127
124
128
128
-
return { readyToUpdate, waiting, completed }
125
125
+
return { readyToUpdate, inProgress, completed }
129
126
}