-
{track.title}
+
+ {track.title}
+
{track.genre.map((g) => (
{
try {
- const res = await fetch(`${API_BASE}/api/ethos/licensing-agreements?id=${id}`, {
- method: "PUT",
- headers: {
- "x-user-id": user!.id,
- "Content-Type": "application/json",
+ const res = await fetch(
+ `${API_BASE}/api/ethos/licensing-agreements?id=${id}`,
+ {
+ method: "PUT",
+ headers: {
+ "x-user-id": user!.id,
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ approved: true }),
},
- body: JSON.stringify({ approved: true }),
- });
+ );
if (res.ok) {
setAgreements((prev) =>
- prev.map((a) =>
- a.id === id ? { ...a, approved: true } : a,
- ),
+ prev.map((a) => (a.id === id ? { ...a, approved: true } : a)),
);
toast.success({
title: "Agreement approved",
@@ -134,7 +130,11 @@ export default function LicensingDashboard() {
};
if (loading) {
- return Loading agreements...
;
+ return (
+
+ Loading agreements...
+
+ );
}
const pendingCount = agreements.filter((a) => !a.approved).length;
@@ -172,7 +172,9 @@ export default function LicensingDashboard() {
- Pending
+
+ Pending
+
{pendingCount}
@@ -181,7 +183,9 @@ export default function LicensingDashboard() {
- Approved
+
+ Approved
+
{approvedCount}
@@ -287,11 +291,7 @@ interface AgreementCardProps {
onDelete: () => void;
}
-function AgreementCard({
- agreement,
- onApprove,
- onDelete,
-}: AgreementCardProps) {
+function AgreementCard({ agreement, onApprove, onDelete }: AgreementCardProps) {
const formatDate = (date: string) => {
return new Date(date).toLocaleDateString("en-US", {
year: "numeric",
@@ -300,11 +300,12 @@ function AgreementCard({
});
};
- const licenseTypeLabel = {
- commercial_one_time: "One-time License",
- commercial_exclusive: "Exclusive License",
- broadcast: "Broadcast License",
- }[agreement.license_type] || agreement.license_type;
+ const licenseTypeLabel =
+ {
+ commercial_one_time: "One-time License",
+ commercial_exclusive: "Exclusive License",
+ broadcast: "Broadcast License",
+ }[agreement.license_type] || agreement.license_type;
return (
@@ -347,7 +348,9 @@ function AgreementCard({
{agreement.expires_at && (
Expires
-
{formatDate(agreement.expires_at)}
+
+ {formatDate(agreement.expires_at)}
+
)}
@@ -360,7 +363,11 @@ function AgreementCard({
asChild
className="border-slate-700"
>
-
+
View Contract
diff --git a/client/pages/ethos/TrackLibrary.tsx b/client/pages/ethos/TrackLibrary.tsx
index 0c6a3070..c86ca16f 100644
--- a/client/pages/ethos/TrackLibrary.tsx
+++ b/client/pages/ethos/TrackLibrary.tsx
@@ -69,15 +69,21 @@ export default function TrackLibrary() {
params.append("limit", "100");
if (searchQuery) params.append("search", searchQuery);
- if (selectedGenre !== "All Genres") params.append("genre", selectedGenre);
- if (licenseFilter !== "all") params.append("licenseType", licenseFilter);
+ if (selectedGenre !== "All Genres")
+ params.append("genre", selectedGenre);
+ if (licenseFilter !== "all")
+ params.append("licenseType", licenseFilter);
const res = await fetch(`${API_BASE}/api/ethos/tracks?${params}`);
const { data } = await res.json();
let sorted = [...data];
if (sortBy === "newest") {
- sorted.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
+ sorted.sort(
+ (a, b) =>
+ new Date(b.created_at).getTime() -
+ new Date(a.created_at).getTime(),
+ );
} else if (sortBy === "popular") {
sorted.sort((a, b) => b.download_count - a.download_count);
}
@@ -122,8 +128,9 @@ export default function TrackLibrary() {
Discover Ethos Music & SFX
- Browse original music and sound effects created by Ethos Guild artists.
- Use freely in your projects or license commercially.
+ Browse original music and sound effects created by Ethos
+ Guild artists. Use freely in your projects or license
+ commercially.
@@ -144,7 +151,10 @@ export default function TrackLibrary() {