Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

thread-title-regeneration-menu.ts

17 lines489 Bytes

1import type { MenuAction } from "@react-native-menu/menu";
2​
3export function buildThreadTitleRegenerationMenuItems(input: {
4 readonly supported: boolean;
5 readonly isRegenerating: boolean;
6}): MenuAction[] {
7 if (!input.supported) return [];
8​
9 return [
10 {
11 id: "regenerate-title",
12 title: input.isRegenerating ? "Regenerating…" : "Regenerate title",
13 image: "arrow.clockwise",
14 ...(input.isRegenerating ? { attributes: { disabled: true } } : {}),
15 },
16 ];