MCPcopy Create free account
hub / github.com/Devessier/xstatebyexample / AppExampleSandbox

Function AppExampleSandbox

src/components/AppExampleSandbox.tsx:114–230  ·  view source on GitHub ↗
({ Example }: { Example: ExampleComponent })

Source from the content-addressed store, hash-verified

112}
113
114export function AppExampleSandbox({ Example }: { Example: ExampleComponent }) {
115 const [state, send] = useActor(inspectorLauncherMachine);
116
117 return (
118 <div
119 className={cx(
120 css({
121 base: {
122 mx: "-4",
123 py: "12",
124 mt: "12",
125 borderYWidth: 2,
126 borderColor: "gray.300",
127 pos: "relative",
128 },
129 sm: {
130 mx: "0",
131 rounded: "md",
132 borderWidth: 2,
133 },
134 }),
135 "not-prose"
136 )}
137 >
138 <InspectorSetter
139 key={state.context.updateId}
140 Example={Example}
141 inspector={state.context.inspector}
142 />
143
144 <div
145 className={flex({
146 pos: "absolute",
147 right: 0,
148 top: 0,
149 mt: "4",
150 mr: "4",
151 })}
152 >
153 {state.matches("closed") === true ? (
154 <Tooltip.Root openDelay={0} positioning={{ strategy: "fixed" }}>
155 <Tooltip.Trigger
156 onClick={() => {
157 send({
158 type: "inspector.open",
159 });
160 }}
161 className={css({
162 rounded: "full",
163 bgColor: "white",
164 px: "2",
165 py: "0.5",
166 fontSize: "xs",
167 fontWeight: "semibold",
168 color: "gray.900",
169 shadow: "1",
170 borderWidth: "1",
171 borderColor: "gray.300",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected