diff --git a/src/components/participants/ParticipantForm.tsx b/src/components/participants/ParticipantForm.tsx index 7616131..492ddd6 100755 --- a/src/components/participants/ParticipantForm.tsx +++ b/src/components/participants/ParticipantForm.tsx @@ -256,160 +256,148 @@ export function ParticipantForm({ <> - - - - {form.formState.errors.participantCode && ( -

- {form.formState.errors.participantCode.message} -

- )} -

- Unique identifier for this participant within the study -

-
+
+ + + + {form.formState.errors.participantCode && ( +

+ {form.formState.errors.participantCode.message} +

+ )} +
- - - - {form.formState.errors.name && ( -

- {form.formState.errors.name.message} -

- )} -

- Optional: Real name for contact purposes -

-
+ + + + {form.formState.errors.name && ( +

+ {form.formState.errors.name.message} +

+ )} +
- - - - {form.formState.errors.email && ( -

- {form.formState.errors.email.message} -

- )} -

- Optional: For scheduling and communication -

-
- - - - - {form.formState.errors.studyId && ( -

- {form.formState.errors.studyId.message} -

- )} - {mode === "edit" && ( -

- Study cannot be changed after registration -

- )} -
+ + + + {form.formState.errors.email && ( +

+ {form.formState.errors.email.message} +

+ )} +
+
- - - - - {form.formState.errors.age && ( -

- {form.formState.errors.age.message} -

- )} -

- Optional: Age in years (minimum 18) -

-
+
- - - -

- Optional: Gender identity for demographic analysis -

-
+ +
+ + + + {form.formState.errors.studyId && ( +

+ {form.formState.errors.studyId.message} +

+ )} +
+ + + + + {form.formState.errors.age && ( +

+ {form.formState.errors.age.message} +

+ )} +
+ + + + + +
{mode === "create" && ( @@ -505,8 +493,7 @@ export function ParticipantForm({ error={error} onDelete={mode === "edit" ? onDelete : undefined} isDeleting={isDeleting} - - // sidebar={sidebar} // Removed for cleaner UI per user request + sidebar={mode === "create" ? sidebar : undefined} submitText={mode === "create" ? "Register Participant" : "Save Changes"} > {formFields} diff --git a/src/components/participants/ParticipantsTable.tsx b/src/components/participants/ParticipantsTable.tsx index 973b213..46f2f40 100755 --- a/src/components/participants/ParticipantsTable.tsx +++ b/src/components/participants/ParticipantsTable.tsx @@ -24,6 +24,12 @@ import { } from "~/components/ui/dropdown-menu"; import { useStudyContext } from "~/lib/study-context"; import { api } from "~/trpc/react"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "~/components/ui/tooltip"; export type Participant = { id: string; @@ -101,16 +107,32 @@ export const columns: ColumnDef[] = [ const name = row.getValue("name"); const email = row.original.email; return ( -
-
- {String(name) || "No name provided"} -
- {email && ( -
- {email} + +
+
+ + + {String(name) || "No name provided"} + + +

{String(name) || "No name provided"}

+
+
- )} -
+ {email && ( +
+ + + {email} + + +

{email}

+
+
+
+ )} +
+ ); }, }, @@ -120,11 +142,30 @@ export const columns: ColumnDef[] = [ cell: ({ row }) => { const consentGiven = row.getValue("consentGiven"); - if (consentGiven) { - return Consented; - } - - return Pending; + return ( + + + + {consentGiven ? ( + + Consented + + ) : ( + + Pending + + )} + + +

+ {consentGiven + ? "Participant has signed the consent form." + : "Consent form has not been recorded."} +

+
+
+
+ ); }, }, { diff --git a/src/components/studies/StudyForm.tsx b/src/components/studies/StudyForm.tsx index 77ea81c..6caec78 100755 --- a/src/components/studies/StudyForm.tsx +++ b/src/components/studies/StudyForm.tsx @@ -14,6 +14,7 @@ import { SelectTrigger, SelectValue, } from "~/components/ui/select"; +import { Separator } from "~/components/ui/separator"; import { Textarea } from "~/components/ui/textarea"; import { EntityForm, @@ -165,103 +166,124 @@ export function StudyForm({ mode, studyId }: StudyFormProps) { // Form fields const formFields = ( - - - - - {form.formState.errors.name && ( -

- {form.formState.errors.name.message} -

- )} -
+
+ +
+ + + + {form.formState.errors.name && ( +

+ {form.formState.errors.name.message} +

+ )} +
- - -