Add contains of version onto version item on the list
This commit is contained in:
@@ -239,18 +239,6 @@ export default function OpenHoursForm() {
|
||||
}
|
||||
};
|
||||
|
||||
const tooltipText = (version: LokOpenHours) =>
|
||||
[
|
||||
version.name,
|
||||
version.paragraph1,
|
||||
version.paragraph2,
|
||||
version.paragraph3,
|
||||
version.paragraph4,
|
||||
version.kitchenNotice,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
|
||||
const nameRequired = useMemo(() => form.name.trim().length === 0, [form.name]);
|
||||
|
||||
return (
|
||||
@@ -283,6 +271,13 @@ export default function OpenHoursForm() {
|
||||
const active = version.isActive;
|
||||
const deleting = deletingId === versionId;
|
||||
const settingActive = activatingId === versionId;
|
||||
const contentLines = [
|
||||
version.paragraph1,
|
||||
version.paragraph2,
|
||||
version.paragraph3,
|
||||
version.paragraph4,
|
||||
version.kitchenNotice,
|
||||
].filter((line) => line.trim().length > 0);
|
||||
|
||||
return (
|
||||
<article
|
||||
@@ -295,7 +290,7 @@ export default function OpenHoursForm() {
|
||||
} ${deleting ? "-translate-y-1 scale-90 opacity-0" : ""} ${settingActive && !active ? "opacity-80" : ""
|
||||
}`}
|
||||
>
|
||||
<div className="mb-2 flex items-center justify-between gap-2" title={tooltipText(version)}>
|
||||
<div className="mb-2 flex items-center justify-between gap-2">
|
||||
<p className="truncate font-medium text-[#4C250E]">
|
||||
{version.name || t("home.openHours.latest")}
|
||||
</p>
|
||||
@@ -306,6 +301,16 @@ export default function OpenHoursForm() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{contentLines.length > 0 && (
|
||||
<div className="mb-3 space-y-1 text-xs text-[#70421E]">
|
||||
{contentLines.map((line, index) => (
|
||||
<p key={`${version.id}-${index}`} className="line-clamp-2">
|
||||
{line}
|
||||
</p>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user