diff --git a/src/components/general/ttyd-iframe.tsx b/src/components/general/ttyd-iframe.tsx new file mode 100644 index 0000000..801b01c --- /dev/null +++ b/src/components/general/ttyd-iframe.tsx @@ -0,0 +1,113 @@ +import Border from "@/twui/components/elements/Border"; +import Loading from "@/twui/components/elements/Loading"; +import LucideIcon from "@/twui/components/elements/lucide-icon"; +import useStatus from "@/twui/components/hooks/useStatus"; +import Button from "@/twui/components/layout/Button"; +import Center from "@/twui/components/layout/Center"; +import Row from "@/twui/components/layout/Row"; +import Span from "@/twui/components/layout/Span"; +import Stack from "@/twui/components/layout/Stack"; +import { + ComponentProps, + DetailedHTMLProps, + Fragment, + IframeHTMLAttributes, + ReactNode, +} from "react"; +import { twMerge } from "tailwind-merge"; + +type Props = Omit< + DetailedHTMLProps< + IframeHTMLAttributes, + HTMLIFrameElement + >, + "title" +> & { + url: string; + wrapperProps?: ComponentProps; + title?: string | ReactNode; +}; + +export default function TtydIframe({ + url, + wrapperProps, + title, + ...props +}: Props) { + const { loading, setLoading } = useStatus(); + + return ( + + + + + {title ? ( + + + {title} + + + + ) : null} + + + + {url} + + + + + + + + +
+ {loading ? ( +
+ +
+ ) : ( +