Skip to content

Commit

Permalink
feat(shared/ui/cuhacking/components): create terminal text
Browse files Browse the repository at this point in the history
  • Loading branch information
HasithDeAlwis authored and MFarabi619 committed Nov 21, 2024
1 parent 7c77678 commit 5cace7f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { TerminalText } from './terminal-text'
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import type Media from '@cuhacking/types/media'
import type { ReactNode } from 'react'
import { cn } from '@shadcn/lib/utils'
import { cva } from 'class-variance-authority'
import React from 'react'
import { Icon } from '../icon/icon'

interface TerminalTextProps {
children: ReactNode
icon?: Media
className?: string
callToAction?: boolean
}

const callToActionVariation = cva(
'',
{
variants: {
callToAction: {
true: 'bg-greendiant bg-clip-text text-transparent',
false: '',
},
},
},
)

const terminalTextVariation = cva(
'flex flex-row gap-x-3 font-sans items-center',
)

export function TerminalText({ icon, children, className = '', callToAction }: TerminalTextProps) {
return (
<div className={cn(terminalTextVariation({ className }))}>
{ !icon
? (
<div className="text-muted">
~
</div>
)
: <Icon media={icon} />}
<div className={cn(callToActionVariation({ callToAction }))}>
{children}
</div>
</div>
)
}

0 comments on commit 5cace7f

Please sign in to comment.