mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-15 12:23:51 +00:00
ac0d5832b6
* install sass * refact: integration settings - OSC in its own HTTP endpoint - OSC settings have own object in db * refact: simplify event cycle * refact: restructure external triggers http * refact: restructure external triggers osc+socket * refact: restructure data updates * feat: osc integration class * IO improvements - timer uses osc integration - create trigger handler to manage external triggers * refact: refract state machine update * Integration: simple HTTP Client * Integration: http options in datamodel * Integration: call http send on life cycle * feat/62-logging: fix issue #71
61 lines
1.8 KiB
React
61 lines
1.8 KiB
React
import { Icon } from '@chakra-ui/react';
|
|
import { useState } from 'react';
|
|
import { FiChevronUp } from 'react-icons/fi';
|
|
import style from './Info.module.scss';
|
|
|
|
export default function InfoTitle(props) {
|
|
const [collapsed, setCollapsed] = useState(false);
|
|
|
|
const { title, data, roll } = props;
|
|
|
|
const noTitl = data.title == null || data.title === '';
|
|
const noPres = data.presenter == null || data.presenter === '';
|
|
const noSubt = data.subtitle == null || data.subtitle === '';
|
|
const noNote = data.note == null || data.note === '';
|
|
|
|
return (
|
|
<div className={style.container}>
|
|
<div className={roll ? style.headerRoll : style.header}>
|
|
{title}
|
|
{collapsed && (
|
|
<span className={style.collapsedTitle}>{data.title}</span>
|
|
)}
|
|
<Icon
|
|
className={collapsed ? style.moreCollapsed : style.moreExpanded}
|
|
as={FiChevronUp}
|
|
onClick={() => setCollapsed((c) => !c)}
|
|
/>
|
|
</div>
|
|
|
|
{!collapsed && (
|
|
<>
|
|
<div className={style.labelContainer}>
|
|
<span className={noTitl ? style.emptyLabel : style.label}>
|
|
Title
|
|
</span>
|
|
{data.title}
|
|
</div>
|
|
<div className={style.labelContainer}>
|
|
<span className={noPres ? style.emptyLabel : style.label}>
|
|
Presenter
|
|
</span>
|
|
{data.presenter}
|
|
</div>
|
|
<div className={style.labelContainer}>
|
|
<span className={noSubt ? style.emptyLabel : style.label}>
|
|
Subtitle
|
|
</span>
|
|
{data.subtitle}
|
|
</div>
|
|
<div className={style.notes}>
|
|
<span className={noNote ? style.emptyLabel : style.label}>
|
|
Note
|
|
</span>
|
|
{data.note}
|
|
</div>
|
|
</>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|