|
1 |
| -import { makeStyles } from "@mui/styles"; |
2 |
| -import { FC, PropsWithChildren } from "react"; |
| 1 | +import { type Interpolation, type Theme } from "@emotion/react"; |
| 2 | +import { type FC, type PropsWithChildren } from "react"; |
3 | 3 |
|
4 | 4 | export const DividerWithText: FC<PropsWithChildren> = ({ children }) => {
|
5 |
| - const classes = useStyles(); |
6 | 5 | return (
|
7 |
| - <div className={classes.container}> |
8 |
| - <div className={classes.border} /> |
9 |
| - <span className={classes.content}>{children}</span> |
10 |
| - <div className={classes.border} /> |
| 6 | + <div css={styles.container}> |
| 7 | + <div css={styles.border} /> |
| 8 | + <span css={styles.content}>{children}</span> |
| 9 | + <div css={styles.border} /> |
11 | 10 | </div>
|
12 | 11 | );
|
13 | 12 | };
|
14 | 13 |
|
15 |
| -const useStyles = makeStyles((theme) => ({ |
| 14 | +const styles = { |
16 | 15 | container: {
|
17 | 16 | display: "flex",
|
18 | 17 | alignItems: "center",
|
19 | 18 | },
|
20 |
| - border: { |
| 19 | + border: (theme) => ({ |
21 | 20 | borderBottom: `2px solid ${theme.palette.divider}`,
|
22 | 21 | width: "100%",
|
23 |
| - }, |
24 |
| - content: { |
| 22 | + }), |
| 23 | + content: (theme) => ({ |
25 | 24 | paddingTop: theme.spacing(0.5),
|
26 | 25 | paddingBottom: theme.spacing(0.5),
|
27 | 26 | paddingRight: theme.spacing(2),
|
28 | 27 | paddingLeft: theme.spacing(2),
|
29 | 28 | fontSize: theme.typography.h5.fontSize,
|
30 | 29 | color: theme.palette.text.secondary,
|
31 |
| - }, |
32 |
| -})); |
| 30 | + }), |
| 31 | +} satisfies Record<string, Interpolation<Theme>>; |
0 commit comments