fleet/frontend/pages/admin/components/SideNav/SideNav.tsx
jacobshandling 46f8cf4b12
UI: Set Mac Recovery Lock passwords (#41166)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #39723 

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`
- [x] Added/updated automated tests
- [ ] QA'd all new/changed functionality manually
  - [x] With spoofed data
  - [ ] Integrated with backend (wip)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Recovery Lock Passwords: new OS Settings card to enable/disable
enforcement and save changes.
* Host Actions: view a host's Recovery Lock password via a modal from
the host actions menu.
* Activity tracking: new activity entries for viewing, setting,
enabling, and disabling Recovery Lock passwords.
  * Navigation: added a dedicated route for Passwords under OS Settings.

* **Documentation**
* Updated guidance for updating local config after an update to ensure
latest values.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-03-10 10:05:01 -07:00

54 lines
1.3 KiB
TypeScript

import React from "react";
import classnames from "classnames";
import { IAppConfigFormProps } from "pages/admin/OrgSettingsPage/cards/constants";
import SideNavItem from "../SideNavItem";
const baseClass = "side-nav";
export interface ISideNavItem<T> {
title: string;
urlSection: string;
path: string;
Card: React.ComponentType<T>;
exclude?: boolean;
}
interface ISideNavProps<T> {
navItems: ISideNavItem<T>[];
activeItem: string;
CurrentCard: React.ReactNode;
className?: string;
}
function SideNav<T = IAppConfigFormProps>({
navItems,
activeItem,
CurrentCard,
className,
}: ISideNavProps<T>) {
const classes = classnames(baseClass, className);
return (
<div className={classes}>
<div className={`${baseClass}__container`}>
<nav aria-label="settings">
<ul className={`${baseClass}__nav-list`}>
{navItems.map((navItem) => (
<SideNavItem
key={navItem.title}
title={navItem.title}
path={navItem.path}
isActive={navItem.urlSection === activeItem}
/>
))}
</ul>
</nav>
<div className={`${baseClass}__card-container`}>{CurrentCard}</div>
</div>
</div>
);
}
export default SideNav;