utopia-ui/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx
Ulf Gebhardt 3872a052b6
separated types, eslint rule for importing types
- Separated types and moved them into the proper ./types folder defined
in the tsconfig.json.
- Defined a new folder alias `#types`.
- New eslint rule to enforce `import type` when a type is imported.
- Removed Geometry Class and used manual Point types from `geojson`
2024-11-24 04:11:32 +01:00

44 lines
1.1 KiB
TypeScript

import SocialShareBar from './SocialShareBar'
import type { Item } from '#types/Item'
export const GroupSubHeaderView = ({
item,
shareBaseUrl,
platforms,
}: {
item: Item
shareBaseUrl: string
platforms?: string[]
}) => (
<div className='tw-px-6'>
<div className='tw-float-left tw-mt-2 tw-mb-4 tw-flex tw-items-center'>
{item.status && (
<div className='tw-mt-1.5'>
<span className='tw-text-sm tw-text-current tw-bg-base-300 tw-rounded tw-py-0.5 tw-px-2 tw-inline-flex tw-items-center tw-mr-2'>
{item.status}
</span>
</div>
)}
{item.group_type && (
<div className='tw-mt-1.5'>
<span className='tw-text-sm tw-text-current tw-bg-base-300 tw-rounded tw-py-1 tw-px-2'>
{item.group_type}
</span>
</div>
)}
</div>
<div>
<SocialShareBar
url={
shareBaseUrl && item.slug
? shareBaseUrl + item.slug
: window.location.protocol + '//' + window.location.host + '/item/' + item.id
}
title={item.name}
platforms={platforms}
/>
</div>
</div>
)