Restore markdown width constraints and add overlay cleanup
This commit is contained in:
parent
9d20d3c163
commit
f30c29614f
|
|
@ -29,6 +29,11 @@ interface MarkdownViewerProps {
|
||||||
* Mostrar mensaje de error personalizado
|
* Mostrar mensaje de error personalizado
|
||||||
*/
|
*/
|
||||||
onError?: (error: Error) => void;
|
onError?: (error: Error) => void;
|
||||||
|
/**
|
||||||
|
* Forzar ancho completo del contenido en pantallas grandes.
|
||||||
|
* Útil para guías visuales donde el contenido debe ocupar todo el ancho.
|
||||||
|
*/
|
||||||
|
fullWidth?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -47,6 +52,7 @@ const MarkdownViewer = ({
|
||||||
className = '',
|
className = '',
|
||||||
showLoading = true,
|
showLoading = true,
|
||||||
onError,
|
onError,
|
||||||
|
fullWidth = false,
|
||||||
}: MarkdownViewerProps) => {
|
}: MarkdownViewerProps) => {
|
||||||
const [content, setContent] = useState<string>('');
|
const [content, setContent] = useState<string>('');
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
|
|
@ -114,8 +120,10 @@ const MarkdownViewer = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renderizar Markdown
|
// Renderizar Markdown
|
||||||
|
const widthClasses = fullWidth ? 'max-w-none' : 'max-w-none md:max-w-prose lg:max-w-[700px]';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`prose prose-slate dark:prose-invert max-w-none ${className}`}>
|
<div className={`prose prose-slate dark:prose-invert ${widthClasses} ${className}`}>
|
||||||
<ReactMarkdown
|
<ReactMarkdown
|
||||||
remarkPlugins={[remarkGfm, remarkFrontmatter]}
|
remarkPlugins={[remarkGfm, remarkFrontmatter]}
|
||||||
rehypePlugins={[
|
rehypePlugins={[
|
||||||
|
|
|
||||||
|
|
@ -25,16 +25,20 @@ const EmergencyModeOverlay = ({ isOpen, onClose }: EmergencyModeOverlayProps) =>
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isOpen) return;
|
if (!isOpen) return;
|
||||||
|
let isCancelled = false;
|
||||||
const event = createEmergencyEvent();
|
const event = createEmergencyEvent();
|
||||||
setEventId(event.id);
|
setEventId(event.id);
|
||||||
setStage('select');
|
setStage('select');
|
||||||
setSituation(null);
|
setSituation(null);
|
||||||
|
|
||||||
getLocationSnapshot().then((location) => {
|
getLocationSnapshot().then((location) => {
|
||||||
if (location) {
|
if (!isCancelled && location) {
|
||||||
updateEmergencyEvent(event.id, { location });
|
updateEmergencyEvent(event.id, { location });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return () => {
|
||||||
|
isCancelled = true;
|
||||||
|
};
|
||||||
}, [isOpen]);
|
}, [isOpen]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue