MCPcopy Create free account
hub / github.com/Nutlope/llamacoder / AppVersionButton

Function AppVersionButton

components/app-version-button.tsx:4–103  ·  view source on GitHub ↗
({
  version,
  filename,
  fileCount,
  appTitle,
  generating,
  disabled,
  onClick,
  isActive,
}: {
  version: number;
  filename?: { name: string; extension: string };
  fileCount?: number;
  appTitle?: string;
  generating?: boolean;
  disabled: boolean;
  onClick?: () => void;
  isActive?: boolean;
})

Source from the content-addressed store, hash-verified

2import { toTitleCase } from "@/lib/utils";
3
4export function AppVersionButton({
5 version,
6 filename,
7 fileCount,
8 appTitle,
9 generating,
10 disabled,
11 onClick,
12 isActive,
13}: {
14 version: number;
15 filename?: { name: string; extension: string };
16 fileCount?: number;
17 appTitle?: string;
18 generating?: boolean;
19 disabled: boolean;
20 onClick?: () => void;
21 isActive?: boolean;
22}) {
23 return (
24 <div className="my-4">
25 <button
26 disabled={disabled}
27 className={`inline-flex w-full items-center gap-2 rounded-lg border-4 border-gray-300 p-1.5 ${
28 generating
29 ? "animate-pulse"
30 : isActive !== undefined
31 ? isActive
32 ? "bg-white"
33 : "bg-gray-300 hover:border-gray-400 hover:bg-gray-400"
34 : ""
35 }`}
36 onClick={onClick}
37 >
38 <div
39 className={`flex size-8 items-center justify-center rounded font-bold ${
40 isActive !== undefined
41 ? isActive
42 ? "bg-gray-300"
43 : "bg-gray-200"
44 : "bg-gray-300"
45 }`}
46 >
47 V{version}
48 </div>
49 <div className="flex flex-col gap-0.5 text-left leading-none">
50 {generating ? (
51 <div className="text-sm font-medium leading-none">
52 Generating...
53 </div>
54 ) : fileCount ? (
55 <>
56 <div className="text-sm font-medium leading-none">
57 Version {version}
58 {appTitle ? ` - ${appTitle}` : ""}
59 </div>
60 <div className="text-xs leading-none text-gray-500">
61 {fileCount} file{fileCount !== 1 ? "s" : ""} edited

Callers

nothing calls this directly

Calls 1

toTitleCaseFunction · 0.90

Tested by

no test coverage detected