2023-07-11 19:54:57 +00:00
|
|
|
import { theme } from '../stitches.config';
|
2023-05-29 18:29:02 +00:00
|
|
|
|
2023-05-28 02:25:59 +00:00
|
|
|
export interface TitleBarProps {
|
|
|
|
|
name: string;
|
|
|
|
|
nameDiscriminator?: string;
|
|
|
|
|
image?: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function TitleBar({
|
|
|
|
|
name,
|
|
|
|
|
nameDiscriminator,
|
|
|
|
|
image,
|
|
|
|
|
description,
|
|
|
|
|
}: TitleBarProps) {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
2023-08-06 18:53:57 +00:00
|
|
|
justifyContent: 'center',
|
|
|
|
|
overflow: 'hidden',
|
2023-05-28 02:25:59 +00:00
|
|
|
}}
|
|
|
|
|
>
|
2023-08-06 18:53:57 +00:00
|
|
|
<div style={{ display: 'flex', gap: 8 }}>
|
2023-05-30 17:24:24 +00:00
|
|
|
{image && (
|
|
|
|
|
<img
|
|
|
|
|
style={{ width: 64, height: 64, objectFit: 'contain' }}
|
|
|
|
|
src={image}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
2023-05-28 02:25:59 +00:00
|
|
|
|
2023-05-30 17:24:24 +00:00
|
|
|
<div
|
2023-08-06 18:53:57 +00:00
|
|
|
style={{
|
|
|
|
|
display: 'flex',
|
|
|
|
|
alignItems: 'center',
|
|
|
|
|
justifyContent: 'center',
|
|
|
|
|
flexDirection: 'column',
|
|
|
|
|
gap: 4,
|
|
|
|
|
}}
|
2023-05-30 17:24:24 +00:00
|
|
|
>
|
|
|
|
|
<div
|
2023-05-28 02:25:59 +00:00
|
|
|
style={{
|
2023-05-30 17:24:24 +00:00
|
|
|
display: 'flex',
|
2023-05-28 02:25:59 +00:00
|
|
|
gap: 4,
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-05-30 17:24:24 +00:00
|
|
|
<span
|
|
|
|
|
style={{
|
|
|
|
|
fontSize: 32,
|
|
|
|
|
color: theme.colors.textHighContrast,
|
|
|
|
|
fontWeight: 900,
|
|
|
|
|
whiteSpace: 'nowrap',
|
2023-08-07 22:54:55 +00:00
|
|
|
maxWidth: nameDiscriminator === undefined ? Infinity : 240,
|
2023-08-06 18:53:57 +00:00
|
|
|
overflow: 'hidden',
|
2023-05-30 17:24:24 +00:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{name}
|
|
|
|
|
</span>
|
2023-05-28 02:25:59 +00:00
|
|
|
{nameDiscriminator && (
|
2023-05-30 17:24:24 +00:00
|
|
|
<span
|
|
|
|
|
style={{
|
|
|
|
|
fontSize: 32,
|
|
|
|
|
color: theme.colors.textLowContrast,
|
|
|
|
|
fontWeight: 900,
|
|
|
|
|
whiteSpace: 'nowrap',
|
|
|
|
|
}}
|
|
|
|
|
>
|
2023-05-29 18:29:02 +00:00
|
|
|
{nameDiscriminator}
|
|
|
|
|
</span>
|
2023-05-28 02:25:59 +00:00
|
|
|
)}
|
2023-05-30 17:24:24 +00:00
|
|
|
</div>
|
2023-05-28 02:25:59 +00:00
|
|
|
|
2023-05-29 18:29:02 +00:00
|
|
|
<span style={{ color: theme.colors.textLowContrast, fontSize: 16 }}>
|
|
|
|
|
{description}
|
|
|
|
|
</span>
|
2023-05-28 02:25:59 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|