@grafana/ui
Version:
Grafana Components Library
27 lines (24 loc) • 702 B
JavaScript
import { jsx } from 'react/jsx-runtime';
import { css } from '@emotion/css';
import { useStyles2 } from '../../../themes/ThemeContext.mjs';
;
const TimeZoneTitle = ({ title }) => {
const styles = useStyles2(getStyles);
if (!title) {
return null;
}
return /* @__PURE__ */ jsx("span", { className: styles.title, children: title });
};
const getTimeZoneTitle = (info) => {
return info.name.split("/").at(-1).replace(/_/g, " ");
};
const getStyles = (theme) => {
return {
title: css({
fontWeight: theme.typography.fontWeightRegular,
textOverflow: "ellipsis"
})
};
};
export { TimeZoneTitle, getTimeZoneTitle };
//# sourceMappingURL=TimeZoneTitle.mjs.map