MCPcopy Create free account
hub / github.com/bernaferrari/FigmaToCode / FrameworkTabs

Function FrameworkTabs

packages/plugin-ui/src/PluginUI.tsx:56–85  ·  view source on GitHub ↗
({
  frameworks,
  selectedFramework,
  setSelectedFramework,
  showAbout,
  setShowAbout,
}: FrameworkTabsProps)

Source from the content-addressed store, hash-verified

54};
55
56const FrameworkTabs = ({
57 frameworks,
58 selectedFramework,
59 setSelectedFramework,
60 showAbout,
61 setShowAbout,
62}: FrameworkTabsProps) => {
63 return (
64 <div className="grid grid-cols-4 sm:grid-cols-2 md:grid-cols-4 gap-1 grow">
65 {frameworks.map((tab) => (
66 <Button
67 variant="ghost"
68 size="sm"
69 key={`tab ${tab}`}
70 className={`w-full h-8 rounded-md text-sm ${
71 selectedFramework === tab && !showAbout
72 ? "bg-primary text-primary-foreground shadow-xs hover:bg-primary hover:text-primary-foreground dark:hover:bg-primary"
73 : "bg-muted text-foreground hover:bg-primary/90 hover:text-primary-foreground dark:hover:bg-primary/90"
74 }`}
75 onClick={() => {
76 setSelectedFramework(tab as Framework);
77 setShowAbout(false);
78 }}
79 >
80 {tab}
81 </Button>
82 ))}
83 </div>
84 );
85};
86
87export const PluginUI = (props: PluginUIProps) => {
88 const [showAbout, setShowAbout] = useState(false);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected