diff --git a/packages/frontend/src/components/organisation-select.tsx b/packages/frontend/src/components/organisation-select.tsx index 18fb358..c1b8efd 100644 --- a/packages/frontend/src/components/organisation-select.tsx +++ b/packages/frontend/src/components/organisation-select.tsx @@ -20,6 +20,7 @@ export function OrganisationSelect({ onCreateOrganisation, placeholder = "Select Organisation", contentClass, + labelPosition = "top", }: { organisations: OrganisationResponse[]; selectedOrganisation: OrganisationResponse | null; @@ -27,6 +28,7 @@ export function OrganisationSelect({ onCreateOrganisation?: (organisationId: number) => void | Promise; placeholder?: string; contentClass?: string; + labelPosition?: "top" | "bottom"; }) { const [open, setOpen] = useState(false); @@ -43,7 +45,13 @@ export function OrganisationSelect({ }} onOpenChange={setOpen} > - + diff --git a/packages/frontend/src/components/project-select.tsx b/packages/frontend/src/components/project-select.tsx index 5a79491..d51acda 100644 --- a/packages/frontend/src/components/project-select.tsx +++ b/packages/frontend/src/components/project-select.tsx @@ -20,6 +20,7 @@ export function ProjectSelect({ onSelectedProjectChange, onCreateProject, placeholder = "Select Project", + labelPosition = "top", }: { projects: ProjectResponse[]; selectedProject: ProjectResponse | null; @@ -27,6 +28,7 @@ export function ProjectSelect({ onSelectedProjectChange: (project: ProjectResponse | null) => void; onCreateProject?: (projectId: number) => void | Promise; placeholder?: string; + labelPosition?: "top" | "bottom"; }) { const [open, setOpen] = useState(false); @@ -43,7 +45,13 @@ export function ProjectSelect({ }} onOpenChange={setOpen} > - + diff --git a/packages/frontend/src/components/ui/select.tsx b/packages/frontend/src/components/ui/select.tsx index 057dd34..e857587 100644 --- a/packages/frontend/src/components/ui/select.tsx +++ b/packages/frontend/src/components/ui/select.tsx @@ -21,10 +21,16 @@ function SelectTrigger({ size = "default", children, isOpen, + label, + hasValue, + labelPosition = "top", ...props }: React.ComponentProps & { isOpen?: boolean; size?: "sm" | "default"; + label?: string; + hasValue?: boolean; + labelPosition?: "top" | "bottom"; }) { return ( + {label && hasValue && ( + + {label} + + )} {children}