okami.mom/web-extract-go
git clone https://git.nkp.pet/okami.mom/web-extract-go
5a90548
main
1import type { ReactNode } from "react" 2import { Badge } from "@/components/ui/badge" 3import { pretty , safeURL } from "@/lib/api" 4 5export function Notice ({ children} :{ children :ReactNode }) { 6return < p role = "alert" className = "notice" >{ children }</ p > 7} 8export function Empty ({ children} :{ children :ReactNode }) { 9return < div className = "empty" >{ children }</ div > 10} 11export function Status ({ error, children} :{ error ?:boolean ; children :ReactNode }) { 12return < Badge variant = { error ?"destructive" :"secondary" }>{ children }</ Badge > 13} 14export function JSONView ({ value} :{ value :unknown }) { 15return < pre className = "json-view" tabIndex = { 0 }>{ pretty ( value )}</ pre > 16} 17export function SourceLink ({ url, children} :{ url :string ; children ?:ReactNode }) { 18const href = safeURL ( url ) 19return href ?< a className = "source-link" href = { href } target = "_blank" rel = "noreferrer" >{ children || url }</ a > :< span className = "break-all" >{ children || url }</ span > 20}