diff --git a/src/app/(protected)/settings/_components/services-registry-components.tsx b/src/app/(protected)/settings/_components/services-registry-components.tsx index e52d5087..3095fd06 100644 --- a/src/app/(protected)/settings/_components/services-registry-components.tsx +++ b/src/app/(protected)/settings/_components/services-registry-components.tsx @@ -143,6 +143,7 @@ type EditorProps = { formError: string; trades: DropdownOption[]; templates: CompletionDocTemplateOption[]; + canChangeActiveState: boolean; isSaving: boolean; onClose: () => void; onSave: () => void; @@ -156,6 +157,7 @@ export function ServiceEditorDrawer({ formError, trades, templates, + canChangeActiveState, isSaving, onClose, onSave, @@ -250,6 +252,17 @@ export function ServiceEditorDrawer({ /> ))} + {mode === "edit" && canChangeActiveState && ( + onUpdate("isActive", event.target.checked)} + /> + } + label="Active" + /> + )} Completion Document diff --git a/src/app/(protected)/settings/_components/services-registry-view.tsx b/src/app/(protected)/settings/_components/services-registry-view.tsx index 6c8c2d23..fab5e02f 100644 --- a/src/app/(protected)/settings/_components/services-registry-view.tsx +++ b/src/app/(protected)/settings/_components/services-registry-view.tsx @@ -96,6 +96,7 @@ export function ServicesRegistryView() { ) : controller.filteredServices.length === 0 ? ( ) : ( @@ -163,6 +164,7 @@ export function ServicesRegistryView() { formError={controller.formError} trades={controller.trades} templates={controller.templates} + canChangeActiveState={controller.canDeactivate} isSaving={controller.isSaving} onClose={controller.closeEditor} onSave={controller.save} @@ -180,16 +182,31 @@ export function ServicesRegistryView() { ); } -function EmptyServices({ search, onAdd }: { search: boolean; onAdd?: () => void }) { +function EmptyServices({ + search, + status, + onAdd, +}: { + search: boolean; + status: ServiceStatus; + onAdd?: () => void; +}) { + const statusLabel = status === "active" ? "active" : "inactive"; return ( - {search ? "No services found" : "No services configured yet"} + {search + ? "No services found" + : status === "all" + ? "No services configured yet" + : `No ${statusLabel} services configured yet`} {search ? "Try a different search, or add a new service." - : "Add a service to make it available for work orders."} + : status === "all" + ? "Add a service to make it available for work orders." + : `There are no ${statusLabel} services matching this view.`} {onAdd !== undefined && (