Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
dashboard
/
components
/
RowOptions
/
File Content:
RowOptionsButton.tsx
import React from 'react'; import { Icon, ModalsController } from '@grafana/ui'; import { OnRowOptionsUpdate } from './RowOptionsForm'; import { RowOptionsModal } from './RowOptionsModal'; export interface RowOptionsButtonProps { title: string; repeat?: string; onUpdate: OnRowOptionsUpdate; warning?: React.ReactNode; } export const RowOptionsButton = ({ repeat, title, onUpdate, warning }: RowOptionsButtonProps) => { const onUpdateChange = (hideModal: () => void) => (title: string, repeat?: string | null) => { onUpdate(title, repeat); hideModal(); }; return ( <ModalsController> {({ showModal, hideModal }) => { return ( <button type="button" className="pointer" aria-label="Row options" onClick={() => { showModal(RowOptionsModal, { title, repeat, onDismiss: hideModal, onUpdate: onUpdateChange(hideModal), warning, }); }} > <Icon name="cog" /> </button> ); }} </ModalsController> ); }; RowOptionsButton.displayName = 'RowOptionsButton';
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
RowOptionsButton.tsx
1220 bytes
0644
RowOptionsForm.test.tsx
1166 bytes
0644
RowOptionsForm.tsx
1794 bytes
0644
RowOptionsModal.tsx
848 bytes
0644
N4ST4R_ID | Naxtarrr