mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
b946b245c2
* feat: create the first event from the cuesheet * chore: cleanup css * test: cuesheet beckground edit from empty state * feat: only show +event button when user is in edit mode and have full write perms
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { SupportedEntry } from 'ontime-types';
|
|
import { IoAdd } from 'react-icons/io5';
|
|
|
|
import { useTranslation } from '../../../translation/TranslationProvider';
|
|
import Button from '../buttons/Button';
|
|
import Empty from './Empty';
|
|
|
|
import style from './EmptyTableBody.module.scss';
|
|
|
|
interface EmptyTableBodyProps {
|
|
handleAddNew?: (type: SupportedEntry) => void;
|
|
}
|
|
|
|
export default function EmptyTableBody({ handleAddNew }: EmptyTableBodyProps) {
|
|
const { getLocalizedString } = useTranslation();
|
|
const text = getLocalizedString('common.no_data');
|
|
return (
|
|
<tbody className={style.emptyContainer}>
|
|
<tr>
|
|
<td colSpan={99} className={style.emptyCell}>
|
|
<Empty injectedStyles={{ marginTop: '5vh' }} />
|
|
<span className={style.text}>{text}</span>
|
|
{handleAddNew && (
|
|
<div className={style.inline}>
|
|
<Button onClick={() => handleAddNew(SupportedEntry.Event)} variant='primary' size='large'>
|
|
<IoAdd />
|
|
Create Event
|
|
</Button>
|
|
</div>
|
|
)}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
);
|
|
}
|