forked from y-scope/yscope-log-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomListItem.tsx
50 lines (45 loc) · 1.03 KB
/
CustomListItem.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from "react";
import {
ListItem,
ListItemContent,
ListItemDecorator,
Typography,
TypographyProps,
} from "@mui/joy";
interface CustomListItemProps {
content: string,
icon: React.ReactNode,
slotProps?: {
content?: TypographyProps
},
title: string
}
/**
* Renders a custom list item with an icon, a title and a context text.
*
* @param props
* @param props.content
* @param props.icon
* @param props.slotProps
* @param props.title
* @return
*/
const CustomListItem = ({content, icon, slotProps, title}: CustomListItemProps) => (
<ListItem>
<ListItemDecorator>
{icon}
</ListItemDecorator>
<ListItemContent>
<Typography level={"title-sm"}>
{title}
</Typography>
<Typography
{...slotProps?.content}
level={"body-sm"}
>
{content}
</Typography>
</ListItemContent>
</ListItem>
);
export default CustomListItem;