Add visibility status to videos in the admin panel
Implement a new 'isPublic' field for videos, allowing administrators to control the visibility status (Published or Draft) of videos through the admin interface and display this status in the video management list. Updates the EditVideoDialog to include a select component for managing this status. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 170e18f0-0f13-4eca-8643-546bba1dd8cc Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/170e18f0-0f13-4eca-8643-546bba1dd8cc/VKclsor
This commit is contained in:
parent
d7e3dfe56f
commit
7fe22b5f46
BIN
attached_assets/image_1756820470854.png
Normal file
BIN
attached_assets/image_1756820470854.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
@ -165,7 +165,16 @@ function VideoManagement({
|
||||
className="w-24 h-16 object-cover rounded"
|
||||
/>
|
||||
<div className="flex-1 min-w-0">
|
||||
<div className="flex items-center space-x-2 mb-1">
|
||||
<h3 className="font-semibold text-white truncate">{video.title}</h3>
|
||||
<span className={`px-2 py-1 text-xs rounded-full ${
|
||||
video.isPublic
|
||||
? 'bg-green-500/20 text-green-300 border border-green-500/30'
|
||||
: 'bg-orange-500/20 text-orange-300 border border-orange-500/30'
|
||||
}`}>
|
||||
{video.isPublic ? 'Published' : 'Draft'}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-sm text-white/70 truncate">{video.description}</p>
|
||||
<div className="flex items-center space-x-4 mt-1">
|
||||
<Badge variant="outline" className="text-xs border-white/20 text-white/80">
|
||||
@ -221,6 +230,7 @@ function EditVideoDialog({
|
||||
contentType: video.contentType,
|
||||
genre: video.genre,
|
||||
customThumbnailUrl: video.customThumbnailUrl || "",
|
||||
isPublic: video.isPublic !== undefined ? video.isPublic : true,
|
||||
});
|
||||
|
||||
// Update form data when video prop changes
|
||||
@ -236,6 +246,7 @@ function EditVideoDialog({
|
||||
contentType: video.contentType,
|
||||
genre: video.genre,
|
||||
customThumbnailUrl: video.customThumbnailUrl || "",
|
||||
isPublic: video.isPublic !== undefined ? video.isPublic : true,
|
||||
});
|
||||
}, [video]);
|
||||
const [isGeneratingAI, setIsGeneratingAI] = useState(false);
|
||||
@ -494,7 +505,7 @@ function EditVideoDialog({
|
||||
</div>
|
||||
|
||||
|
||||
<div className="md:col-span-2">
|
||||
<div>
|
||||
<Label className="text-white/90">Custom Thumbnail URL</Label>
|
||||
<Input
|
||||
value={formData.customThumbnailUrl}
|
||||
@ -503,6 +514,22 @@ function EditVideoDialog({
|
||||
placeholder="https://example.com/thumbnail.jpg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Label className="text-white/90">Visibility Status</Label>
|
||||
<Select
|
||||
value={formData.isPublic ? "public" : "private"}
|
||||
onValueChange={(value) => setFormData({ ...formData, isPublic: value === "public" })}
|
||||
>
|
||||
<SelectTrigger className="bg-white/10 border-white/20 text-white">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent className="bg-[#2D1B69] border-white/20">
|
||||
<SelectItem value="public">Published (Public)</SelectItem>
|
||||
<SelectItem value="private">Draft (Private)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end space-x-4">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user