Skip to content

Commit aea4c83

Browse files
Updating demo DB song # notice
1 parent 0ad1524 commit aea4c83

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

src/components/song-search-panel.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ export function SongSearchPanel(props: {
274274

275275
const results =
276276
!queryTooShort && !requiresCoreSearchTerm ? (data?.results ?? []) : [];
277+
const resolvedInfoNote = props.infoNote?.replace(
278+
"{count}",
279+
String(data?.total ?? 0)
280+
);
277281
const totalPages = Math.max(
278282
1,
279283
Math.ceil((data?.total ?? 0) / (data?.pageSize ?? 25))
@@ -441,12 +445,12 @@ export function SongSearchPanel(props: {
441445
{props.description}
442446
</p>
443447
) : null}
444-
{props.infoNote ? (
448+
{resolvedInfoNote ? (
445449
<div className="mt-4 rounded-[20px] border border-sky-400/30 bg-sky-500/10 px-4 py-3 text-sm text-sky-100">
446450
<p className="font-semibold uppercase tracking-[0.18em] text-sky-200">
447451
Note:
448452
</p>
449-
<p className="mt-2">{props.infoNote}</p>
453+
<p className="mt-2">{resolvedInfoNote}</p>
450454
</div>
451455
) : null}
452456
</div>

src/routes/$slug/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ function PublicChannelPage() {
206206
</div>
207207
</div>
208208

209+
<SongSearchPanel
210+
title="Search to add a song"
211+
description="Copy the request command and use it in Twitch chat."
212+
placeholder={`Search songs for ${channelDisplayName}`}
213+
/>
214+
209215
<Card>
210216
<CardHeader className="flex flex-row items-center justify-between gap-4">
211217
<div className="flex items-center gap-3">
@@ -302,12 +308,6 @@ function PublicChannelPage() {
302308
</CardContent>
303309
) : null}
304310
</Card>
305-
306-
<SongSearchPanel
307-
title="Search to add a song"
308-
description="Copy the request command and use it in Twitch chat."
309-
placeholder={`Search songs for ${channelDisplayName}`}
310-
/>
311311
</section>
312312
);
313313
}

src/routes/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function SearchPage() {
1515
<SongSearchPanel
1616
eyebrow="Search"
1717
title="Songs"
18-
infoNote="This demo only contains 50 songs."
18+
infoNote="This demo only contains {count} songs."
1919
placeholder="Search by song title, artist or album"
2020
/>
2121
);

0 commit comments

Comments
 (0)