mirror of
https://github.com/JOYCEQL/magic-resume.git
synced 2026-05-06 22:02:27 +08:00
style: standardize BaseInfo layout and text wrapping across all resume templates
This commit is contained in:
@@ -23,7 +23,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -59,9 +59,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-left min-w-0" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-right min-w-0" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0" },
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-left min-w-0 max-w-[16rem] flex-1" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-right min-w-0 max-w-[16rem] flex-1" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0 max-w-full" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -73,10 +73,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={cn("flex flex-col", styles.nameTitle)}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,17 +85,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont">
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont">
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex min-w-0 items-start gap-1">
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate">{item.value}</a> : <span>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]">{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden">
|
||||
{!item.custom && <span>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning>{item.value}</a> : <span className="truncate" suppressHydrationWarning>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2">
|
||||
{!item.custom && <span className="shrink-0">{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0">{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -25,7 +25,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -61,9 +61,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-left min-w-0" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-right min-w-0" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0" },
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-left min-w-0 max-w-[16rem] flex-1" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-right min-w-0 max-w-[16rem] flex-1" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0 max-w-full" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -75,10 +75,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={cn("flex flex-col", styles.nameTitle)} style={{ color: "#fff" }}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px", color: "#fff" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px", color: "#fff" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px", color: "#fff" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px", color: "#fff" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,17 +88,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont" style={{ color: "#fff" }}>
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont" style={{ color: "#fff" }}>
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1" style={{ color: "#fff" }}>
|
||||
<div className="flex min-w-0 items-start gap-1" style={{ color: "#fff" }}>
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline" style={{ color: "#fff" }}>{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate" style={{ color: "#fff" }}>{item.value}</a> : <span style={{ color: "#fff" }}>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]" style={{ color: "#fff" }}>{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" style={{ color: "#fff" }}>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" style={{ color: "#fff" }}>{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden" style={{ color: "#fff" }}>
|
||||
{!item.custom && <span style={{ color: "#fff" }}>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span style={{ color: "#fff" }}>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</a> : <span className="truncate" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2" style={{ color: "#fff" }}>
|
||||
{!item.custom && <span className="shrink-0" style={{ color: "#fff" }}>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0" style={{ color: "#fff" }}>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -58,7 +58,7 @@ const BaseInfo: React.FC<BaseInfoProps> = ({ basic, globalSettings }) => {
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-3.5 h-3.5" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-3.5 w-3.5 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const showPhoto = basic.photo && basic.photoConfig?.visible;
|
||||
@@ -71,7 +71,7 @@ const BaseInfo: React.FC<BaseInfoProps> = ({ basic, globalSettings }) => {
|
||||
{basic.name && nameField.visible !== false && (
|
||||
<motion.h1
|
||||
layout="position"
|
||||
className="font-bold tracking-widest whitespace-pre-wrap break-words text-black"
|
||||
className="font-bold tracking-widest whitespace-normal break-normal [overflow-wrap:normal] text-black"
|
||||
style={{ fontSize: `${(globalSettings?.headerSize || 20) * 2}px`, lineHeight: "1.1", marginBottom: "8px" }}
|
||||
>
|
||||
{basic.name}
|
||||
@@ -101,7 +101,7 @@ const BaseInfo: React.FC<BaseInfoProps> = ({ basic, globalSettings }) => {
|
||||
<div className="flex-1 min-w-[100px] shrink-0">
|
||||
<motion.h2
|
||||
layout="position"
|
||||
className="font-normal tracking-wide text-gray-700 whitespace-pre-wrap break-words"
|
||||
className="font-normal tracking-wide text-gray-700 whitespace-normal break-normal [overflow-wrap:normal]"
|
||||
style={{ fontSize: `${globalSettings?.subheaderSize || 16}px`, lineHeight: "1.3" }}
|
||||
>
|
||||
{basic.title}
|
||||
@@ -117,29 +117,29 @@ const BaseInfo: React.FC<BaseInfoProps> = ({ basic, globalSettings }) => {
|
||||
: null;
|
||||
|
||||
return (
|
||||
<div key={item.key} className="flex items-center gap-2 overflow-hidden">
|
||||
<div key={item.key} className="flex items-start gap-2">
|
||||
{globalSettings?.useIconMode && (
|
||||
<span className="text-gray-400 shrink-0">
|
||||
<span className="inline-flex shrink-0 text-gray-400">
|
||||
{getIcon(item.custom ? (item as any).icon : basic.icons?.[item.key as keyof typeof basic.icons])}
|
||||
</span>
|
||||
)}
|
||||
<div className="truncate min-w-0">
|
||||
<div className="min-w-0">
|
||||
{item.key === "email" ? (
|
||||
<a href={`mailto:${item.value}`} className="hover:text-black transition-colors truncate block">
|
||||
<a href={`mailto:${item.value}`} className="block min-w-0 transition-colors [overflow-wrap:anywhere] hover:text-black">
|
||||
{globalSettings?.useIconMode ? "" : `${t(`basicPanel.basicFields.${item.key}`)}: `}
|
||||
{item.value}
|
||||
</a>
|
||||
) : item.key === "website" || item.key === "github" ? (
|
||||
<a href={item.value.startsWith("http") ? item.value : `https://${item.value}`} className="hover:text-black transition-colors truncate block">
|
||||
<a href={item.value.startsWith("http") ? item.value : `https://${item.value}`} className="block min-w-0 transition-colors [overflow-wrap:anywhere] hover:text-black">
|
||||
{globalSettings?.useIconMode ? "" : `${item.label}: `}
|
||||
{item.value.replace(/^https?:\/\//, "")}
|
||||
</a>
|
||||
) : customFieldHref ? (
|
||||
<a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="hover:text-black transition-colors truncate block underline">
|
||||
<a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="block min-w-0 underline transition-colors [overflow-wrap:anywhere] hover:text-black">
|
||||
{item.value}
|
||||
</a>
|
||||
) : (
|
||||
<span className="truncate block">
|
||||
<span className="block min-w-0 [overflow-wrap:anywhere]">
|
||||
{globalSettings?.useIconMode
|
||||
? ""
|
||||
: item.custom
|
||||
|
||||
@@ -23,7 +23,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -59,9 +59,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-left min-w-0" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-right min-w-0" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0" },
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-left min-w-0 max-w-[16rem] flex-1" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-right min-w-0 max-w-[16rem] flex-1" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0 max-w-full" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -73,10 +73,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={cn("flex flex-col", styles.nameTitle)}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,17 +85,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont">
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont">
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex min-w-0 items-start gap-1">
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate">{item.value}</a> : <span>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]">{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden">
|
||||
{!item.custom && <span>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning>{item.value}</a> : <span className="truncate" suppressHydrationWarning>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2">
|
||||
{!item.custom && <span className="shrink-0">{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0">{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -23,7 +23,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -59,9 +59,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-left min-w-0" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-right min-w-0" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0" },
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-left min-w-0 max-w-[16rem] flex-1" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-right min-w-0 max-w-[16rem] flex-1" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0 max-w-full" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -73,10 +73,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={cn("flex flex-col", styles.nameTitle)}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,17 +85,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont">
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont">
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex min-w-0 items-start gap-1">
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate">{item.value}</a> : <span>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]">{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden">
|
||||
{!item.custom && <span>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning>{item.value}</a> : <span className="truncate" suppressHydrationWarning>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2">
|
||||
{!item.custom && <span className="shrink-0">{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0">{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -23,7 +23,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -59,9 +59,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-left min-w-0" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-right min-w-0" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0" },
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-left min-w-0 max-w-[16rem] flex-1" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-right min-w-0 max-w-[16rem] flex-1" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0 max-w-full" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -73,10 +73,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={cn("flex flex-col", styles.nameTitle)}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,17 +85,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont">
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont">
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex min-w-0 items-start gap-1">
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate">{item.value}</a> : <span>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]">{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden">
|
||||
{!item.custom && <span>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning>{item.value}</a> : <span className="truncate" suppressHydrationWarning>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2">
|
||||
{!item.custom && <span className="shrink-0">{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0">{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -25,7 +25,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -61,9 +61,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex flex-col gap-3", header: "flex items-center gap-4", nameTitle: "text-left min-w-0", fields: "w-full flex flex-col gap-2" },
|
||||
right: { container: "flex flex-col gap-3", header: "flex flex-row-reverse items-center gap-4", nameTitle: "text-right min-w-0", fields: "w-full flex flex-col gap-2" },
|
||||
center: { container: "flex flex-col items-center gap-3", header: "flex flex-col items-center gap-4", nameTitle: "text-center min-w-0", fields: "w-full flex flex-col gap-2" },
|
||||
left: { container: "flex flex-col gap-3", header: "flex items-center gap-4", nameTitle: "text-left min-w-[10rem] max-w-full flex-1", fields: "w-full flex flex-col gap-2" },
|
||||
right: { container: "flex flex-col gap-3", header: "flex flex-row-reverse items-center gap-4", nameTitle: "text-right min-w-[10rem] max-w-full flex-1", fields: "w-full flex flex-col gap-2" },
|
||||
center: { container: "flex flex-col items-center gap-3", header: "flex flex-col items-center gap-4", nameTitle: "text-center min-w-0 max-w-full", fields: "w-full flex flex-col gap-2" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -75,10 +75,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={`flex flex-col ${styles.nameTitle}`} style={{ color: "#fff" }}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px", color: "#fff" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px", color: "#fff" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px", color: "#fff" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px", color: "#fff" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -88,17 +88,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont" style={{ width: "100%", color: "#fff" }}>
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont" style={{ width: "100%", color: "#fff" }}>
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1" style={{ color: "#fff" }}>
|
||||
<div className="flex min-w-0 items-start gap-1" style={{ color: "#fff" }}>
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline" style={{ color: "#fff" }}>{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate" style={{ color: "#fff" }}>{item.value}</a> : <span style={{ color: "#fff" }}>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]" style={{ color: "#fff" }}>{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" style={{ color: "#fff" }}>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" style={{ color: "#fff" }}>{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden" style={{ color: "#fff" }}>
|
||||
{!item.custom && <span style={{ color: "#fff" }}>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span style={{ color: "#fff" }}>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</a> : <span className="truncate" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2" style={{ color: "#fff" }}>
|
||||
{!item.custom && <span className="shrink-0" style={{ color: "#fff" }}>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0" style={{ color: "#fff" }}>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning style={{ color: "#fff" }}>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
@@ -23,7 +23,7 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
|
||||
const getIcon = (iconName: string | undefined) => {
|
||||
const IconComponent = Icons[iconName as keyof typeof Icons] as React.ElementType;
|
||||
return IconComponent ? <IconComponent className="w-4 h-4" /> : null;
|
||||
return IconComponent ? <IconComponent className="mt-[0.2em] h-4 w-4 shrink-0" /> : null;
|
||||
};
|
||||
|
||||
const getOrderedFields = React.useMemo(() => {
|
||||
@@ -59,9 +59,9 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
);
|
||||
|
||||
const layoutStyles = {
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-left min-w-0" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 flex-1 min-w-0", fields: "grid grid-cols-2 gap-x-8 gap-y-2 justify-start shrink-0", nameTitle: "text-right min-w-0" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0" },
|
||||
left: { container: "flex items-center justify-between gap-6", leftContent: "flex items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-left min-w-0 max-w-[16rem] flex-1" },
|
||||
right: { container: "flex items-center justify-between gap-6 flex-row-reverse", leftContent: "flex flex-row-reverse justify-start items-center gap-6 shrink-0 min-w-0 max-w-[42%]", fields: "grid flex-1 min-w-0 grid-cols-2 gap-x-6 gap-y-2 justify-start", nameTitle: "text-right min-w-0 max-w-[16rem] flex-1" },
|
||||
center: { container: "flex flex-col items-center gap-3", leftContent: "flex flex-col items-center gap-4", fields: "w-full flex justify-center items-center flex-wrap gap-3", nameTitle: "text-center min-w-0 max-w-full" },
|
||||
};
|
||||
|
||||
const styles = layoutStyles[layout as keyof typeof layoutStyles] || layoutStyles.left;
|
||||
@@ -73,10 +73,10 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
{PhotoComponent}
|
||||
<div className={cn("flex flex-col", styles.nameTitle)}>
|
||||
{nameField.visible !== false && basic[nameField.key] && (
|
||||
<motion.h1 layout="position" className="font-bold whitespace-pre-wrap break-words" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
<motion.h1 layout="position" className="font-bold whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "30px" }}>{basic[nameField.key] as string}</motion.h1>
|
||||
)}
|
||||
{titleField.visible !== false && basic[titleField.key] && (
|
||||
<motion.h2 layout="position" className="whitespace-pre-wrap break-words" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
<motion.h2 layout="position" className="whitespace-normal break-normal [overflow-wrap:normal]" style={{ fontSize: "18px" }}>{basic[titleField.key] as string}</motion.h2>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,17 +85,17 @@ const BaseInfo = ({ basic = {} as BasicInfo, globalSettings, template }: BaseInf
|
||||
const customFieldHref = item.custom && "href" in item && typeof item.href === "string" ? item.href : null;
|
||||
|
||||
return (
|
||||
<motion.div key={item.key} className="flex items-center whitespace-nowrap overflow-hidden text-baseFont">
|
||||
<motion.div key={item.key} className="flex min-w-0 items-start text-baseFont">
|
||||
{useIconMode ? (
|
||||
<div className="flex items-center gap-1">
|
||||
<div className="flex min-w-0 items-start gap-1">
|
||||
{getIcon(item.icon)}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="underline">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="underline truncate">{item.value}</a> : <span>{item.value}</span>}
|
||||
{item.key === "email" ? <a href={`mailto:${item.value}`} className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]">{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]">{item.value}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 overflow-hidden">
|
||||
{!item.custom && <span>{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span>{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="truncate underline" suppressHydrationWarning>{item.value}</a> : <span className="truncate" suppressHydrationWarning>{item.value}</span>}
|
||||
<div className="flex min-w-0 items-start gap-2">
|
||||
{!item.custom && <span className="shrink-0">{t(`basicPanel.basicFields.${item.key}`)}:</span>}
|
||||
{item.custom && shouldShowCustomFieldLabelPrefix(item) && <span className="shrink-0">{item.label}:</span>}
|
||||
{customFieldHref ? <a href={customFieldHref} target="_blank" rel="noopener noreferrer" className="min-w-0 underline [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</a> : <span className="min-w-0 [overflow-wrap:anywhere]" suppressHydrationWarning>{item.value}</span>}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
|
||||
Reference in New Issue
Block a user