refactor: remove approve/reject, add per-asset Postiz push button
- Remove approve/reject buttons and status badge from asset cards - Remove bulk approve/reject from gallery toolbar - Remove status filter dropdown (no longer relevant) - Add "Postiz" button on each image/video asset card for direct publishing - Keep bulk "Push to Postiz" for multi-select in toolbar - Update How This Works guide to remove approve/reject section Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+14
-39
@@ -3,7 +3,7 @@
|
||||
import { useState } from "react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Check, X, Play, Copy, Sparkles } from "lucide-react";
|
||||
import { Play, Copy, Sparkles, Send } from "lucide-react";
|
||||
import { RepurposeModal } from "./repurpose-modal";
|
||||
import { VariationModal } from "./variation-modal";
|
||||
|
||||
@@ -24,16 +24,16 @@ interface Asset {
|
||||
|
||||
interface AssetCardProps {
|
||||
asset: Asset;
|
||||
onStatusChange: (id: string, status: string) => void;
|
||||
selected?: boolean;
|
||||
onSelect?: (id: string) => void;
|
||||
onPushToPostiz?: (assetIds: string[]) => void;
|
||||
}
|
||||
|
||||
export function AssetCard({
|
||||
asset,
|
||||
onStatusChange,
|
||||
selected,
|
||||
onSelect,
|
||||
onPushToPostiz,
|
||||
}: AssetCardProps) {
|
||||
const [repurposeOpen, setRepurposeOpen] = useState(false);
|
||||
const [variationOpen, setVariationOpen] = useState(false);
|
||||
@@ -144,18 +144,6 @@ export function AssetCard({
|
||||
{asset.dimensions}
|
||||
</Badge>
|
||||
)}
|
||||
<Badge
|
||||
variant={
|
||||
asset.status === "approved"
|
||||
? "default"
|
||||
: asset.status === "rejected"
|
||||
? "destructive"
|
||||
: "secondary"
|
||||
}
|
||||
className="text-xs"
|
||||
>
|
||||
{asset.status}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
{metadata.caption && (
|
||||
@@ -184,33 +172,22 @@ export function AssetCard({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Actions — only for images and videos */}
|
||||
{(isImage || isVideo) ? (
|
||||
<div className="space-y-2">
|
||||
<div className="flex gap-2">
|
||||
{/* Actions */}
|
||||
{(isImage || isVideo) && (
|
||||
<div className="flex gap-2 flex-wrap">
|
||||
{onPushToPostiz && (
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="flex-1 min-w-0 overflow-hidden text-green-600 hover:text-green-700 hover:bg-green-50"
|
||||
onClick={() => onStatusChange(asset.id, "approved")}
|
||||
disabled={asset.status === "approved"}
|
||||
className="flex-1 min-w-0 overflow-hidden"
|
||||
onClick={() => onPushToPostiz([asset.id])}
|
||||
>
|
||||
<Check className="h-3 w-3 shrink-0" />
|
||||
<span className="truncate">Approve</span>
|
||||
<Send className="h-3 w-3 shrink-0" />
|
||||
<span className="truncate">Postiz</span>
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="flex-1 min-w-0 overflow-hidden text-red-600 hover:text-red-700 hover:bg-red-50"
|
||||
onClick={() => onStatusChange(asset.id, "rejected")}
|
||||
disabled={asset.status === "rejected"}
|
||||
>
|
||||
<X className="h-3 w-3 shrink-0" />
|
||||
<span className="truncate">Reject</span>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{isImage && (
|
||||
<div className="flex gap-2">
|
||||
<>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
@@ -229,11 +206,9 @@ export function AssetCard({
|
||||
<Sparkles className="h-3 w-3 shrink-0" />
|
||||
<span className="truncate">Variations</span>
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-xs text-muted-foreground text-center">Auto-accepted</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user