add: more things

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-06 15:21:36 +08:00
parent 41e98bb602
commit 244aa607f7
71 changed files with 2998 additions and 1014 deletions
+21 -22
View File
@@ -114,19 +114,7 @@ const RequirementsStatusPanel = ({ requirements = [], latestCompletion, isVisite
<h2 className="font-semibold text-base">Requirements</h2>
<div className="flex flex-col gap-3">
{items.map(({ key, label, icon, getValue }) => {
const isProvided = reqTypes.includes(key);
if (!isProvided) {
return (
<div key={key} className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2">
{icon}
<span className="text-sm text-muted-foreground">{label}</span>
</div>
<Badge variant="secondary" className="text-xs">Not provided</Badge>
</div>
);
}
{provided.map(({ key, label, icon, getValue }) => {
const { done, total, binary } = getValue();
const complete = total > 0 && done >= total;
return (
@@ -152,9 +140,14 @@ const RequirementsStatusPanel = ({ requirements = [], latestCompletion, isVisite
<div className="flex flex-col gap-2 pt-2 border-t">
<div className="flex items-center justify-between">
<span className="text-sm">Overall progress</span>
<span className="text-sm">{completedCount} / {provided.length} done</span>
{provided.length > 0 && completedCount >= provided.length && (
<span className="text-sm">Completed</span>
)}
</div>
<Progress value={overallPercent} className="h-1.5" />
<Progress
value={overallPercent}
className={`h-1.5 ${provided.length > 0 && completedCount >= provided.length ? "[&>div]:bg-green-500" : ""}`}
/>
</div>
</div>
);
@@ -322,7 +315,12 @@ const ViewTask = () => {
}
if (!uploadedFiles.length) {
toast.error('No files were uploaded successfully.');
toast('No files were uploaded successfully.', {
action: {
label: "Close",
onClick: () => {}
}
});
return;
}
@@ -336,7 +334,12 @@ const ViewTask = () => {
setNote('');
setUploadState({ files: [], isUploading: false });
} catch (err) {
toast.error('Failed to submit. Please try again.');
toast('Failed to submit. Please try again.', {
action: {
label: "Close",
onClick: () => {}
}
});
} finally {
setSubmitting(false);
}
@@ -410,7 +413,7 @@ const ViewTask = () => {
<div className="grid lg:grid-cols-[1fr_350px] gap-6 items-start">
{/* ── Left ──────────────────────────────────────────────── */}
<div className="flex flex-col gap-6 xs:order-2 lg:order-0 min-w-0 w-full max-w-full">
<div className="flex flex-col gap-6 xs:order-1 lg:order-0 min-w-0 w-full max-w-full">
{/* Task header card */}
<div className="border rounded-lg bg-card overflow-hidden">
@@ -448,10 +451,6 @@ const ViewTask = () => {
{/* Requirements section */}
{!isResolving && requirements.length > 0 && (
<>
<div className="flex items-center gap-4 text-lg">
<h1>Requirements</h1>
</div>
{/* visit_link */}
{visitLinkReqs.length > 0 && (
<VisitLink