mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-23 19:27:51 -04:00
fix: update forms pages to use proper page layout
- Remove EntityView wrapper, use standard space-y-6 pattern - Full page width instead of container max-w - Consistent with experiments/participants pages
This commit is contained in:
@@ -180,7 +180,7 @@ export default function FormViewPage({ params }: FormViewPageProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto max-w-4xl space-y-6 py-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<Button variant="ghost" size="sm" asChild>
|
<Button variant="ghost" size="sm" asChild>
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ export default function NewFormPage() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto max-w-4xl space-y-6 py-6">
|
<div className="space-y-6">
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<Button variant="ghost" size="sm" asChild>
|
<Button variant="ghost" size="sm" asChild>
|
||||||
<Link href={`/studies/${studyId}/forms`}>
|
<Link href={`/studies/${studyId}/forms`}>
|
||||||
|
|||||||
@@ -16,16 +16,8 @@ import {
|
|||||||
Pencil,
|
Pencil,
|
||||||
Trash2,
|
Trash2,
|
||||||
Eye,
|
Eye,
|
||||||
Copy,
|
|
||||||
CheckCircle,
|
CheckCircle,
|
||||||
XCircle,
|
|
||||||
Clock,
|
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import {
|
|
||||||
EntityView,
|
|
||||||
EntityViewSection,
|
|
||||||
EmptyState,
|
|
||||||
} from "~/components/ui/entity-view";
|
|
||||||
import { useBreadcrumbsEffect } from "~/components/ui/breadcrumb-provider";
|
import { useBreadcrumbsEffect } from "~/components/ui/breadcrumb-provider";
|
||||||
import { Button } from "~/components/ui/button";
|
import { Button } from "~/components/ui/button";
|
||||||
import { Badge } from "~/components/ui/badge";
|
import { Badge } from "~/components/ui/badge";
|
||||||
@@ -53,24 +45,6 @@ const formTypeColors = {
|
|||||||
questionnaire: "bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",
|
questionnaire: "bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusConfig = {
|
|
||||||
active: {
|
|
||||||
label: "Active",
|
|
||||||
variant: "default" as const,
|
|
||||||
icon: CheckCircle,
|
|
||||||
},
|
|
||||||
draft: {
|
|
||||||
label: "Draft",
|
|
||||||
variant: "secondary" as const,
|
|
||||||
icon: Clock,
|
|
||||||
},
|
|
||||||
deprecated: {
|
|
||||||
label: "Deprecated",
|
|
||||||
variant: "destructive" as const,
|
|
||||||
icon: XCircle,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
interface StudyFormsPageProps {
|
interface StudyFormsPageProps {
|
||||||
params: Promise<{
|
params: Promise<{
|
||||||
id: string;
|
id: string;
|
||||||
@@ -141,7 +115,7 @@ export default function StudyFormsPage({ params }: StudyFormsPageProps) {
|
|||||||
const forms = formsData?.forms ?? [];
|
const forms = formsData?.forms ?? [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EntityView>
|
<div className="space-y-6">
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title="Forms"
|
title="Forms"
|
||||||
description="Manage consent forms, surveys, and questionnaires for this study"
|
description="Manage consent forms, surveys, and questionnaires for this study"
|
||||||
@@ -159,23 +133,23 @@ export default function StudyFormsPage({ params }: StudyFormsPageProps) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{forms.length === 0 && !isLoading ? (
|
{forms.length === 0 && !isLoading ? (
|
||||||
<EmptyState
|
<div className="flex flex-col items-center justify-center py-12 text-center">
|
||||||
icon="FileText"
|
<FileText className="h-12 w-12 text-muted-foreground mb-4" />
|
||||||
title="No Forms Yet"
|
<h3 className="text-lg font-semibold mb-2">No Forms Yet</h3>
|
||||||
description="Create consent forms, surveys, or questionnaires to collect data from participants"
|
<p className="text-muted-foreground mb-4">
|
||||||
action={
|
Create consent forms, surveys, or questionnaires to collect data from participants
|
||||||
canManage ? (
|
</p>
|
||||||
<Button asChild>
|
{canManage && (
|
||||||
<Link href={`/studies/${resolvedParams?.id}/forms/new`}>
|
<Button asChild>
|
||||||
<Plus className="mr-2 h-4 w-4" />
|
<Link href={`/studies/${resolvedParams?.id}/forms/new`}>
|
||||||
Create Your First Form
|
<Plus className="mr-2 h-4 w-4" />
|
||||||
</Link>
|
Create Your First Form
|
||||||
</Button>
|
</Link>
|
||||||
) : null
|
</Button>
|
||||||
}
|
)}
|
||||||
/>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="space-y-6">
|
<div className="space-y-4">
|
||||||
<div className="flex items-center gap-4">
|
<div className="flex items-center gap-4">
|
||||||
<div className="relative flex-1 max-w-sm">
|
<div className="relative flex-1 max-w-sm">
|
||||||
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
|
<Search className="absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
|
||||||
@@ -277,6 +251,6 @@ export default function StudyFormsPage({ params }: StudyFormsPageProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</EntityView>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user