We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b12a2f commit b38625aCopy full SHA for b38625a
frontend/src/Components/dashboard/FeaturedContent.tsx
@@ -14,19 +14,21 @@ export default function FeaturedContent({
14
const [expanded, setExpanded] = useState<boolean>(false);
15
const cols = user?.role == UserRole.Student ? 3 : 4;
16
const slice = expanded ? featured.length : cols;
17
+ const isAdmin =
18
+ user?.role === UserRole.Admin || user?.role === UserRole.SystemAdmin;
19
20
const navigate = useNavigate();
21
22
const handleEmptyStateClick = () => {
- if (
- user?.role === UserRole.Admin ||
23
- user?.role === UserRole.SystemAdmin
24
- ) {
+ if (isAdmin) {
25
navigate('/knowledge-center-management/libraries', {
26
replace: true
27
});
28
}
29
};
+ if (!featured.length && !isAdmin) {
30
+ return null;
31
+ }
32
33
return (
34
<>
0 commit comments