Skip to content
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/pages/government/legislative/[chamber].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function LegislativeDetailSection({
'address',
'trunkline',
'website',
'email',
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed a semicolon here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the missing semicolon


if (isSimpleObject) {
Expand All @@ -59,6 +58,23 @@ function LegislativeDetailSection({
{Object.entries(data).map(([key, value]) => {
if (skipKeys.includes(key) || value === undefined) return null

// Special handling for email fields
if (key === 'email' && value) {
return (
<div key={key} className="text-sm">
<div className="flex items-start">
<Mail className="h-4 w-4 text-gray-400 mr-2 mt-0.5 flex-shrink-0" />
<a
href={`mailto:${value}`}
className="text-primary-600 hover:underline leading-relaxed"
>
{String(value)}
</a>
</div>
</div>
)
}

return (
<div key={key} className="text-sm">
<span className="text-gray-800 leading-relaxed">
Expand Down