-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shared/ui/cuhacking/components): create terminal text
- Loading branch information
1 parent
7c77678
commit 5cace7f
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { TerminalText } from './terminal-text' |
46 changes: 46 additions & 0 deletions
46
libs/shared/ui/src/cuHacking/components/terminal-text/terminal-text.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |