import React, { FC, useState } from 'react'; import { SelectableValue, urlUtil } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { Button, Checkbox, Field, FieldSet, Modal, RadioButtonGroup } from '@grafana/ui'; import { PlaylistDTO, PlaylistMode } from './types'; export interface StartModalProps { playlist: PlaylistDTO; onDismiss: () => void; } export const StartModal: FC = ({ playlist, onDismiss }) => { const [mode, setMode] = useState(false); const [autoFit, setAutofit] = useState(false); const modes: Array> = [ { label: 'Normal', value: false }, { label: 'TV', value: 'tv' }, { label: 'Kiosk', value: true }, ]; const onStart = () => { const params: any = {}; if (mode) { params.kiosk = mode; } if (autoFit) { params.autofitpanels = true; } locationService.push(urlUtil.renderUrl(`/playlists/play/${playlist.uid}`, params)); }; return (
setAutofit(e.currentTarget.checked)} />
); };