fix: resolve all 12 TypeScript errors (tsc --noEmit clean)
- mail.ts: add explicit types to decodeMimeHeader callback params - SessionList.tsx: use React.MouseEvent instead of nativeEvent - ComposeModal.tsx: construct name from first_name + last_name - MailDetail.tsx: destructure onReply/onForward from props - RichTextEditor.tsx: use SetContentOptions object instead of boolean - MailSearchBar.tsx: add optional value prop to interface - EmptyState.tsx: add optional children prop - Badge.tsx: add secondary variant to BadgeVariant, variantClasses, dotColors - ConfirmDialog.tsx: add optional children prop - hooks.ts: extend SearchResult type to include mail/file/event
This commit is contained in:
@@ -92,7 +92,7 @@ export function ComposeModal({
|
||||
if (sig) {
|
||||
const processedHtml = replaceSignatureVariables(
|
||||
sig.body_html,
|
||||
{ name: authUser?.name, email: authUser?.email, role: authUser?.role, first_name: authUser?.first_name, last_name: authUser?.last_name },
|
||||
{ name: authUser ? `${authUser.first_name} ${authUser.last_name}`.trim() : undefined, email: authUser?.email, role: authUser?.role, first_name: authUser?.first_name, last_name: authUser?.last_name },
|
||||
{ name: authTenant?.name },
|
||||
);
|
||||
setBody((prev) => `${prev}<br/><br/>---<br/>${processedHtml}`);
|
||||
|
||||
@@ -44,6 +44,8 @@ function formatBytes(bytes: number): string {
|
||||
export function MailDetail({
|
||||
mail,
|
||||
loading,
|
||||
onReply,
|
||||
onForward,
|
||||
onDownloadAttachment,
|
||||
downloadingAttachmentId,
|
||||
}: MailDetailProps) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Input } from '@/components/ui/Input';
|
||||
|
||||
export interface MailSearchBarProps {
|
||||
onSearch: (query: string) => void;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
export function MailSearchBar({ onSearch }: MailSearchBarProps) {
|
||||
|
||||
@@ -88,7 +88,7 @@ export function RichTextEditor({ content, onChange, placeholder, editable = true
|
||||
// Sync external content changes (e.g. template/signature insert, reply/forward/draft load)
|
||||
React.useEffect(() => {
|
||||
if (editor && content !== editor.getHTML()) {
|
||||
editor.commands.setContent(content, false);
|
||||
editor.commands.setContent(content, { emitUpdate: false });
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [content, editor]);
|
||||
|
||||
Reference in New Issue
Block a user