Add Watch Buddies feature
- Created WatchBuddy model - M:N junctions to EntrySeen/EpisodeSeen and Media relation for profile pictures - Full CRUD + search + profile picture upload - WatchBuddySelect multi-select with search and inline create, replaced all seen_with text inputs - WatchBuddiesPage (grid) and WatchBuddyProfilePage (edit form, icon-based contacts, poster-grid watch history, monthly timeline)
This commit is contained in:
1 parent
4313a794ce
commit
e82b905886
28 files changed
+6813
-374
No files matched your search
@@ -1,7 +1,9 @@
|
||||
import { format } from "date-fns";
|
||||
import { Link } from "react-router-dom";
|
||||
import type { EntrySeen, EpisodeSeen } from "@/types";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Pencil, Trash2 } from "lucide-react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Pencil, Trash2, Users } from "lucide-react";
|
||||
|
||||
interface EpisodeWatchHistoryProps {
|
||||
watchHistory: (EntrySeen | EpisodeSeen)[];
|
||||
@@ -28,7 +30,12 @@ export function EpisodeWatchHistory({
|
||||
<thead>
|
||||
<tr className="border-b border-border bg-muted/50">
|
||||
<th className="px-4 py-2 text-left font-medium">Date</th>
|
||||
<th className="px-4 py-2 text-left font-medium">Seen With</th>
|
||||
<th className="px-4 py-2 text-left font-medium">
|
||||
<span className="flex items-center gap-1">
|
||||
<Users className="h-3 w-3" />
|
||||
Buddies
|
||||
</span>
|
||||
</th>
|
||||
<th className="px-4 py-2 text-right font-medium">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -43,8 +50,23 @@ export function EpisodeWatchHistory({
|
||||
? format(new Date(record.date_seen), "MMM d, yyyy")
|
||||
: "-"}
|
||||
</td>
|
||||
<td className="px-4 py-2 text-muted-foreground">
|
||||
{record.seen_with || "-"}
|
||||
<td className="px-4 py-2">
|
||||
<div className="flex flex-wrap gap-1">
|
||||
{record.buddies && record.buddies.length > 0 ? (
|
||||
record.buddies.map((b) => (
|
||||
<Link key={b.id} to={`/watch-buddies/${b.id}`}>
|
||||
<Badge
|
||||
variant="secondary"
|
||||
className="cursor-pointer text-xs hover:bg-accent"
|
||||
>
|
||||
{b.name}
|
||||
</Badge>
|
||||
</Link>
|
||||
))
|
||||
) : (
|
||||
<span className="text-muted-foreground">-</span>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
<td className="px-4 py-2">
|
||||
<div className="flex justify-end gap-1">
|
||||
|
||||
Reference in new issue
Block a user