Files
supabase/apps/docs/components/Params.tsx
Jonathan Summers-Muir d417850a23 update blocks
2022-11-24 14:13:44 +08:00

31 lines
1.0 KiB
TypeScript

import { FC } from 'react'
import { Flag } from '~/pages/new/reference/cli/[...slug]'
type IParamProps = Flag | any
const Param: FC<IParamProps> = (paramItem) => {
return (
<div className="border-t border-b py-5 flex flex-col gap-3">
<div className="flex gap-3 items-center">
<span className="text-sm text-scale-1200 font-mono font-medium">
{paramItem.name ?? 'no-name'}
</span>
<span>
{paramItem.isOptional ? (
<div className="text-[10px] px-3 tracking-wide font-mono text-scale-900">Optional</div>
) : (
<div className="text-[10px] border border-amber-700 bg-amber-300 text-amber-900 px-2 tracking-wide font-mono py-0.25 rounded-full">
REQUIRED
</div>
)}
</span>
<span className="text-scale-900 text-xs">{paramItem.type ?? 'no type'}</span>
</div>
<p className="text-sm text-scale-1000 m-0">{paramItem.description ?? 'nodescription'}</p>
{paramItem.children}
</div>
)
}
export default Param