21 lines
856 B
TypeScript
21 lines
856 B
TypeScript
import { useState } from "react";
|
|
import { t as i18nT } from "i18next";
|
|
import ButtonPrimary from "../buttons/ButtonPrimary";
|
|
import FloatingLoader from "./FloatingLoader";
|
|
|
|
export default function PreviewFloatingLoader() {
|
|
const [open, setOpen] = useState(false);
|
|
return (
|
|
<div id="floating-loader">
|
|
<div className="not-prose border-border bg-background border border-dashed p-6">
|
|
<div className="mx-auto flex max-w-3xl flex-col items-center justify-center space-y-4 sm:flex-row sm:items-end sm:justify-center sm:space-x-4 sm:space-y-0">
|
|
<ButtonPrimary onClick={() => setOpen(!open)}>
|
|
{open ? i18nT("components.loaders.preview.hideFloating") : i18nT("components.loaders.preview.showFloating")}
|
|
</ButtonPrimary>
|
|
<FloatingLoader loading={open} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|