Prettier format pending files

This commit is contained in:
Builder.io 2025-09-28 02:02:57 +00:00
parent c1b752a762
commit 084a7f9f49

View file

@ -175,9 +175,7 @@ export default function Dashboard() {
try {
const { data, error } = await supabase
.from("project_applications")
.select(
`*, projects!inner(id, title, user_id)`
)
.select(`*, projects!inner(id, title, user_id)`)
.eq("projects.user_id", user!.id)
.order("created_at", { ascending: false })
.limit(10);
@ -583,7 +581,9 @@ export default function Dashboard() {
<Card className="bg-card/50 border-border/50 animate-fade-in">
<CardHeader>
<CardTitle className="text-gradient">Create a Post</CardTitle>
<CardDescription>Share updates, images, or videos</CardDescription>
<CardDescription>
Share updates, images, or videos
</CardDescription>
</CardHeader>
<CardContent>
<PostComposer onPosted={loadDashboardData} />
@ -855,24 +855,49 @@ export default function Dashboard() {
<CardHeader>
<div className="flex justify-between items-center">
<div>
<CardTitle className="text-gradient">Your Recent Posts</CardTitle>
<CardTitle className="text-gradient">
Your Recent Posts
</CardTitle>
<CardDescription>Your latest activity</CardDescription>
</div>
<Button variant="outline" size="sm" className="hover-lift" onClick={() => navigate("/feed")}>Go to Feed</Button>
<Button
variant="outline"
size="sm"
className="hover-lift"
onClick={() => navigate("/feed")}
>
Go to Feed
</Button>
</div>
</CardHeader>
<CardContent className="space-y-3">
{userPosts.length === 0 ? (
<div className="text-sm text-muted-foreground">No posts yet. Share something above.</div>
<div className="text-sm text-muted-foreground">
No posts yet. Share something above.
</div>
) : (
userPosts.map((p: any) => {
let text = "";
try { const obj = JSON.parse(p.content||"{}"); text = obj.text || p.content; } catch { text = p.content; }
try {
const obj = JSON.parse(p.content || "{}");
text = obj.text || p.content;
} catch {
text = p.content;
}
return (
<div key={p.id} className="p-3 rounded border border-border/40 hover:border-aethex-400/50 transition-all">
<div
key={p.id}
className="p-3 rounded border border-border/40 hover:border-aethex-400/50 transition-all"
>
<div className="text-sm font-medium">{p.title}</div>
{text && <div className="text-xs text-muted-foreground line-clamp-2">{text}</div>}
<div className="text-[11px] text-muted-foreground mt-1">{new Date(p.created_at).toLocaleString()}</div>
{text && (
<div className="text-xs text-muted-foreground line-clamp-2">
{text}
</div>
)}
<div className="text-[11px] text-muted-foreground mt-1">
{new Date(p.created_at).toLocaleString()}
</div>
</div>
);
})
@ -977,25 +1002,49 @@ export default function Dashboard() {
<CardHeader>
<div className="flex justify-between items-center">
<div>
<CardTitle className="text-gradient">Project Applications</CardTitle>
<CardDescription>People who applied to your projects</CardDescription>
<CardTitle className="text-gradient">
Project Applications
</CardTitle>
<CardDescription>
People who applied to your projects
</CardDescription>
</div>
</div>
</CardHeader>
<CardContent className="space-y-3">
{applications.length === 0 ? (
<div className="text-sm text-muted-foreground">No applications yet.</div>
<div className="text-sm text-muted-foreground">
No applications yet.
</div>
) : (
applications.map((a: any) => (
<div key={a.id} className="p-3 rounded border border-border/40 hover:border-aethex-400/50 transition-all">
<div
key={a.id}
className="p-3 rounded border border-border/40 hover:border-aethex-400/50 transition-all"
>
<div className="flex items-center justify-between">
<div>
<div className="font-medium text-sm">{a.applicant_name || a.applicant_email || "Applicant"}</div>
<div className="text-xs text-muted-foreground">Applied to: {a.projects?.title || a.project_title || "Project"}</div>
<div className="font-medium text-sm">
{a.applicant_name ||
a.applicant_email ||
"Applicant"}
</div>
<div className="text-xs text-muted-foreground">
Applied to:{" "}
{a.projects?.title ||
a.project_title ||
"Project"}
</div>
</div>
<div className="text-xs text-muted-foreground">
{new Date(a.created_at).toLocaleDateString()}
</div>
<div className="text-xs text-muted-foreground">{new Date(a.created_at).toLocaleDateString()}</div>
</div>
{a.message && <div className="text-xs text-muted-foreground mt-1 line-clamp-2">{a.message}</div>}
{a.message && (
<div className="text-xs text-muted-foreground mt-1 line-clamp-2">
{a.message}
</div>
)}
</div>
))
)}