import { jsx as _jsx } from "react/jsx-runtime";
import { Alert, Space } from '@cube-dev/ui-kit';
import { useMemo } from 'react';
export function LocalError({ error }) {
    const message = useMemo(() => {
        return error?.message ?? String(error) ?? 'Something went wrong.';
    }, [error]);
    return (_jsx(Alert, { theme: "danger", children: _jsx(Space, { direction: "vertical", children: Array.isArray(message) ? _jsx("span", { children: message.join(', ') }) : _jsx("span", { children: message }) }) }));
}
//# sourceMappingURL=LocalError.js.map