ab159f748b
Reduces the amount of boilerplate to render the UI and makes it easier to respond to state changes (e.g. machine getting authorized, netmap changing, etc.) Preact adds ~13K to our bundle size (5K after Brotli) thus is a neglibible size contribution. We mitigate the delay in rendering the UI by having a static placeholder in the HTML. Required bumping the esbuild version to pick up evanw/esbuild#2349, which makes it easier to support Preact's JSX code generation. Fixes #5137 Fixes #5273 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>
|
|
)
|
|
}
|