PermissionsViewer: add to simplified profiles

This commit is contained in:
Vendicated 2024-06-26 14:38:50 +02:00
parent 705da29df5
commit 6d4c9339dc
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
7 changed files with 140 additions and 6 deletions

View file

@ -31,10 +31,20 @@ export interface ExpandableHeaderProps {
headerText: string;
children: React.ReactNode;
buttons?: React.ReactNode[];
forceOpen?: boolean;
}
export function ExpandableHeader({ children, onMoreClick, buttons, moreTooltipText, defaultState = false, onDropDownClick, headerText }: ExpandableHeaderProps) {
const [showContent, setShowContent] = useState(defaultState);
export function ExpandableHeader({
children,
onMoreClick,
buttons,
moreTooltipText,
onDropDownClick,
headerText,
defaultState = false,
forceOpen = false,
}: ExpandableHeaderProps) {
const [showContent, setShowContent] = useState(defaultState || forceOpen);
return (
<>
@ -90,6 +100,7 @@ export function ExpandableHeader({ children, onMoreClick, buttons, moreTooltipTe
setShowContent(v => !v);
onDropDownClick?.(showContent);
}}
disabled={forceOpen}
>
<svg
width="24"