MCPcopy
hub / github.com/protomaps/PMTiles / LinkTab

Function LinkTab

app/src/Frame.tsx:99–126  ·  view source on GitHub ↗
(props: {
  page: string;
  tileset: Accessor<Tileset | undefined>;
  selected: boolean;
})

Source from the content-addressed store, hash-verified

97};
98
99function LinkTab(props: {
100 page: string;
101 tileset: Accessor<Tileset | undefined>;
102 selected: boolean;
103}) {
104 const fragment = createMemo(() => {
105 const t = props.tileset();
106 if (t) {
107 const stateUrl = t.getStateUrl();
108 if (stateUrl) return `#url=${stateUrl}`;
109 }
110 return "";
111 });
112
113 return (
114 <a
115 classList={{
116 "font-bold": props.selected,
117 "py-2": true,
118 "px-4": true,
119 underline: !props.selected,
120 }}
121 href={`/${props.page === "map" ? "" : `${props.page}/`}${fragment()}`}
122 >
123 {props.page}
124 </a>
125 );
126}
127
128export function Frame(props: {
129 tileset: Accessor<Tileset | undefined>;

Callers

nothing calls this directly

Calls 1

getStateUrlMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…