import React from "react"; import { useLink, useRefineOptions } from "@refinedev/core"; import { Center, Text, useMantineTheme } from "@mantine/core"; import type { RefineLayoutThemedTitleProps } from "../types"; export const ThemedTitle: React.FC = ({ collapsed, icon: iconFromProps, text: textFromProps, wrapperStyles = {}, }) => { const { title: { icon: defaultIcon, text: defaultText } = {}, } = useRefineOptions(); const icon = typeof iconFromProps === "undefined" ? defaultIcon : iconFromProps; const text = typeof textFromProps === "undefined" ? defaultText : textFromProps; const theme = useMantineTheme(); const Link = useLink(); return (
{icon} {!collapsed && ( {text} )}
); };