1a093ef482
`src/` is broken up into several subdirectories: - `lib/` and `types`/ for shared code and type definitions (more code will be moved here) - `app/` for the existing Preact-app - `pkg/` for the new NPM package A new `build-pkg` esbuild-based command is added to generate the files for the NPM package. To generate type definitions (something that esbuild does not do), we set up `dts-bundle-generator`. Includes additional cleanups to the Wasm type definitions (we switch to string literals for enums, since exported const enums are hard to use via packages). Also allows the control URL to be set a runtime (in addition to the current build option), so that we don't have to rebuild the package for dev vs. prod use. Updates #5415 Signed-off-by: Mihai Parparita <mihai@tailscale.com>
22 lines
550 B
TypeScript
22 lines
550 B
TypeScript
// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
export function GoPanicDisplay({
|
|
error,
|
|
dismiss,
|
|
}: {
|
|
error: string
|
|
dismiss: () => void
|
|
}) {
|
|
return (
|
|
<div
|
|
class="rounded bg-red-500 p-2 absolute top-2 right-2 text-white font-bold text-right cursor-pointer"
|
|
onClick={dismiss}
|
|
>
|
|
Tailscale has encountered an error.
|
|
<div class="text-sm font-normal">Click to reload</div>
|
|
</div>
|
|
)
|
|
}
|