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
|
||||
*/
|
||||
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 = '',
|
||||
showLoading = true,
|
||||
onError,
|
||||
fullWidth = false,
|
||||
}: MarkdownViewerProps) => {
|
||||
const [content, setContent] = useState<string>('');
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
|
@ -114,8 +120,10 @@ const MarkdownViewer = ({
|
|||
}
|
||||
|
||||
// Renderizar Markdown
|
||||
const widthClasses = fullWidth ? 'max-w-none' : 'max-w-none md:max-w-prose lg:max-w-[700px]';
|
||||
|
||||
return (
|
||||
<div className={`prose prose-slate dark:prose-invert max-w-none ${className}`}>
|
||||
<div className={`prose prose-slate dark:prose-invert ${widthClasses} ${className}`}>
|
||||
<ReactMarkdown
|
||||
remarkPlugins={[remarkGfm, remarkFrontmatter]}
|
||||
rehypePlugins={[
|
||||
|
|
|
|||
|
|
@ -25,16 +25,20 @@ const EmergencyModeOverlay = ({ isOpen, onClose }: EmergencyModeOverlayProps) =>
|
|||
|
||||
useEffect(() => {
|
||||
if (!isOpen) return;
|
||||
let isCancelled = false;
|
||||
const event = createEmergencyEvent();
|
||||
setEventId(event.id);
|
||||
setStage('select');
|
||||
setSituation(null);
|
||||
|
||||
getLocationSnapshot().then((location) => {
|
||||
if (location) {
|
||||
if (!isCancelled && location) {
|
||||
updateEmergencyEvent(event.id, { location });
|
||||
}
|
||||
});
|
||||
return () => {
|
||||
isCancelled = true;
|
||||
};
|
||||
}, [isOpen]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue