Files
ticcat/resources/js/components/SVG.tsx
Romulus21 b326f79f2d add SVG
2024-02-15 22:12:46 +01:00

37 lines
1.4 KiB
TypeScript

import React, {ComponentProps, FC} from "react"
const SVGSkeleton: FC<SVGSkeletonProps> = ({paths, viewBox = "0 0 24 24", className = "", title = null, ...props}) => {
return <svg xmlns="http://www.w3.org/2000/svg"
viewBox={viewBox}
fill="currentColor"
className={className}
{...props}>
{title && <title>{ title }</title>}
{paths}
</svg>
}
interface SVGSkeletonProps {
paths: string,
viewBox?: string,
className?: string,
title?: string,
}
export const DraggableSVG: FC<ComponentProps<any>> = (props) => SVGSkeleton({
paths: <path d="M5 15q-.425 0-.712-.288T4 14q0-.425.288-.712T5 13h14q.425 0 .713.288T20 14q0 .425-.288.713T19 15zm0-4q-.425 0-.712-.288T4 10q0-.425.288-.712T5 9h14q.425 0 .713.288T20 10q0 .425-.288.713T19 11z"/>,
...props
})
export const PlaySVG: FC<ComponentProps<any>> = (props) => SVGSkeleton({
viewBox: "0 0 448 512",
paths: <path
d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"/>,
...props
})
export const StopSVG: FC<ComponentProps<any>> = (props) => SVGSkeleton({
paths: <path d="M8 16h8V8H8zm4 6q-2.075 0-3.9-.788t-3.175-2.137q-1.35-1.35-2.137-3.175T2 12q0-2.075.788-3.9t2.137-3.175q1.35-1.35 3.175-2.137T12 2q2.075 0 3.9.788t3.175 2.137q1.35 1.35 2.138 3.175T22 12q0 2.075-.788 3.9t-2.137 3.175q-1.35 1.35-3.175 2.138T12 22"/>,
...props
})