mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import React from "react"
|
|
import { ContentHeader, SidebarToggleButton } from "@/components/custom/content-header"
|
|
import { PersonalPage } from "@/lib/schema/personal-page"
|
|
import { TopicSelector } from "@/components/custom/topic-selector"
|
|
import { Button } from "@/components/ui/button"
|
|
import { LaIcon } from "@/components/custom/la-icon"
|
|
|
|
interface DetailPageHeaderProps {
|
|
page: PersonalPage
|
|
handleDelete: () => void
|
|
isMobile: boolean
|
|
}
|
|
|
|
export const DetailPageHeader: React.FC<DetailPageHeaderProps> = ({ page, handleDelete, isMobile }) => {
|
|
if (!isMobile) return null
|
|
|
|
return (
|
|
<>
|
|
<ContentHeader className="lg:min-h-0">
|
|
<div className="flex min-w-0 gap-2">
|
|
<SidebarToggleButton />
|
|
</div>
|
|
</ContentHeader>
|
|
|
|
<div className="flex flex-row items-start gap-1.5 border-b px-6 py-2 max-lg:pl-4">
|
|
<TopicSelector
|
|
value={page.topic?.name}
|
|
onTopicChange={topic => {
|
|
page.topic = topic
|
|
page.updatedAt = new Date()
|
|
}}
|
|
align="start"
|
|
variant="outline"
|
|
renderSelectedText={() => <span className="truncate">{page.topic?.prettyName || "Select a topic"}</span>}
|
|
/>
|
|
<Button size="sm" variant="outline" onClick={handleDelete}>
|
|
<LaIcon name="Trash" className="mr-2 size-3.5" />
|
|
Delete
|
|
</Button>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|