Utilização

Offer actions for an episode

Este tipo é usado por ContextMenu

tsx
import { ContextMenu, Text, VStack } from 'kuito';

const ITEMS = [
  { value: 'share', label: 'Share' },
  { value: 'played', label: 'Mark played' },
  { value: 'delete', label: 'Delete', destructive: true },
];

export default function Episode() {
  return (
    <ContextMenu title="Episode 4" items={ITEMS} onSelect={(event) => console.log(event.value)}>
      <VStack padding={12}>
        <Text>Episode 4</Text>
      </VStack>
    </ContextMenu>
  );
}

Declaração do tipo

ts
export type ContextMenuItem = {
  value: string;
  label: string;
  /** Drawn as an action that deletes or discards, in red. */
  destructive?: boolean;
  /** Shown dimmed; the user can't pick it. */
  disabled?: boolean;
};

Membros 4

NomeTipoObrigatórioDescrição
valuestringSim—
labelstringSim—
destructivebooleanNãoDrawn as an action that deletes or discards, in red.
disabledbooleanNãoShown dimmed; the user can't pick it.
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.