Remove unused persona marketplace and discover page files.
This commit is contained in:
@@ -109,30 +109,3 @@ if (recent) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const featured = document.querySelector("#featuredPersonas");
|
||||
if (featured) {
|
||||
const result = await get("/api/discover");
|
||||
const search = document.querySelector("#publicSearch");
|
||||
function render() {
|
||||
featured.replaceChildren();
|
||||
if (result.error) { featured.textContent = result.error; return; }
|
||||
const query = search?.value.trim().toLowerCase() || "";
|
||||
let personas = (result.personas || []).filter(persona => `${persona.name} ${persona.description || ""}`.toLowerCase().includes(query));
|
||||
if (!search) personas = personas.slice(0, 3);
|
||||
if (!personas.length) { featured.textContent = query ? "No personas match your search." : "The community is just getting started. Create a persona and give the next story its voice."; return; }
|
||||
for (const persona of personas) {
|
||||
const card = document.createElement("article"); card.className = "feature-card";
|
||||
const category = document.createElement("span"); category.className = "feature-number"; category.textContent = persona.persona_type === "assistant" ? "AI CHARACTER" : "USER PERSONA";
|
||||
const title = document.createElement("h3"); title.textContent = persona.name;
|
||||
const description = document.createElement("p"); description.textContent = persona.description || "A community persona, ready for a new conversation.";
|
||||
const creator = document.createElement("p"); creator.textContent = `By ${persona.creator_username}`;
|
||||
const link = document.createElement("a"); const destination = `/market?persona=${persona.id}`;
|
||||
link.href = session.user ? destination : `/login?next=${encodeURIComponent(destination)}`;
|
||||
link.textContent = session.user ? "Explore persona \u2192" : "Sign in to use persona \u2192";
|
||||
card.append(category, title, description, creator, link); featured.append(card);
|
||||
}
|
||||
}
|
||||
render(); search?.addEventListener("input", render);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user