mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
* wip * wip * wip * wwip * wip * wip * fix(util): rmeove checking to existing in slug * wip * chore: handle create page * chore: handle page title untitled
39 lines
1001 B
TypeScript
39 lines
1001 B
TypeScript
import React from "react"
|
|
import { cn } from "@/lib/utils"
|
|
|
|
interface ColumnWrapperProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
style?: { [key: string]: string }
|
|
}
|
|
|
|
interface ColumnTextProps extends React.HTMLAttributes<HTMLSpanElement> {}
|
|
|
|
const ColumnWrapper = React.forwardRef<HTMLDivElement, ColumnWrapperProps>(
|
|
({ children, className, style, ...props }, ref) => (
|
|
<div
|
|
className={cn("flex grow flex-row items-center justify-start", className)}
|
|
style={{
|
|
width: "var(--width)",
|
|
minWidth: "var(--min-width, min-content)",
|
|
maxWidth: "min(var(--width), var(--max-width))",
|
|
flexBasis: "var(--width)",
|
|
...style
|
|
}}
|
|
ref={ref}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</div>
|
|
)
|
|
)
|
|
|
|
const ColumnText = React.forwardRef<HTMLSpanElement, ColumnTextProps>(({ children, className, ...props }, ref) => (
|
|
<span className={cn("text-left text-xs", className)} ref={ref} {...props}>
|
|
{children}
|
|
</span>
|
|
))
|
|
|
|
export const Column = {
|
|
Wrapper: ColumnWrapper,
|
|
Text: ColumnText
|
|
}
|