mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
change things
This commit is contained in:
@@ -74,7 +74,7 @@ function AssetCard({ asset, streamSrc, selected, onSelect }) {
|
||||
function EmptyState({ fileType }) {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-48 gap-2">
|
||||
<p className="text-sm text-muted-foreground">No {fileType} assets found.</p>
|
||||
<p className="text-sm text-muted-foreground">No {fileType} files found.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ export function AssetPickerSheet({ open, onOpenChange, fileType, onSelect, allow
|
||||
|
||||
const label = fileType
|
||||
? `${fileType.charAt(0).toUpperCase()}${fileType.slice(1)}s`
|
||||
: "Assets";
|
||||
: "Files";
|
||||
|
||||
const hasActiveFilters = activeExts.size > 0;
|
||||
|
||||
@@ -221,7 +221,7 @@ export function AssetPickerSheet({ open, onOpenChange, fileType, onSelect, allow
|
||||
{/* ── Header ── */}
|
||||
<SheetHeader className="px-6 pt-6 pb-4 border-b">
|
||||
<SheetTitle>Select {label}</SheetTitle>
|
||||
<SheetDescription>Click an asset to attach it.</SheetDescription>
|
||||
<SheetDescription>Click a file to attach it.</SheetDescription>
|
||||
</SheetHeader>
|
||||
|
||||
{/* ── Search + Filter ── */}
|
||||
|
||||
@@ -28,7 +28,7 @@ const TARGET_CONFIGS = {
|
||||
fetch: () => api.get("/admin/tiers", { params: { limit: 100 } }).then((res) => res.data?.data?.data ?? []),
|
||||
idKey: "plan_id",
|
||||
labelKey: "label",
|
||||
placeholder: "Select a tier plan…",
|
||||
placeholder: "Select a subscription plan…",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -12,12 +12,12 @@ export default function DashboardGrid({ sections = [] }) {
|
||||
|
||||
return (
|
||||
<section className="bg-muted/60">
|
||||
<div className="lg:container lg:mx-auto flex flex-col items-start gap-8 px-4">
|
||||
<div className="lg:container lg:mx-auto flex flex-col items-start gap-8 p-4">
|
||||
{sections.map(({ title, description, tiles }) => (
|
||||
<div key={title} className="flex flex-col items-start gap-4 w-full">
|
||||
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-2 mt-6">
|
||||
<div className="flex flex-col gap-2">
|
||||
<h1 className="text-2xl leading-tighter font-medium tracking-tighter">
|
||||
{title}
|
||||
</h1>
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
// components/generic/UploadProgressToast.jsx
|
||||
//
|
||||
// Floating widget mounted once in AdminLayout (outside the router Outlet's
|
||||
// unmount cycle) so it keeps showing asset-upload progress no matter what
|
||||
// admin page you navigate to mid-upload. State comes from UploadQueueContext,
|
||||
// which lives above the router for the same reason.
|
||||
// unmount cycle) so it keeps showing Add Assets Bulk's upload progress no
|
||||
// matter what admin page you navigate to mid-batch. State comes from
|
||||
// UploadQueueContext, which lives above the router for the same reason.
|
||||
//
|
||||
// Only renders "bulk"-sourced jobs — Add File (single) uploads share the
|
||||
// same underlying queue (so they too survive navigation) but get their own
|
||||
// SingleUploadToast instead of being folded into this multi-file "N of M"
|
||||
// widget, which was designed around an actual batch and reads oddly for a
|
||||
// single file.
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
@@ -17,7 +23,8 @@ const ACTIVE = new Set(["uploading", "queued"]);
|
||||
const FAILED = new Set(["failed", "invalid"]);
|
||||
|
||||
export default function UploadProgressToast() {
|
||||
const { jobs, retryJob } = useUploadQueue();
|
||||
const { jobs: allJobs, retryJob } = useUploadQueue();
|
||||
const jobs = allJobs.filter((j) => j.source === "bulk");
|
||||
const navigate = useNavigate();
|
||||
const [dismissed, setDismissed] = useState(false);
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
@@ -91,7 +98,7 @@ export default function UploadProgressToast() {
|
||||
<button
|
||||
type="button"
|
||||
className="w-full text-xs text-primary hover:underline py-2"
|
||||
onClick={() => navigate("/admin/assets/add")}
|
||||
onClick={() => navigate("/admin/assets/add/bulk")}
|
||||
>
|
||||
View upload details
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user